Operatoren
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package org.eidecker.oca8lernen.general;
|
||||
|
||||
import com.sun.xml.internal.ws.api.message.HeaderList;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
@@ -19,6 +23,11 @@ public class PrimitiveUndWrapperTest {
|
||||
int aInt = 1;
|
||||
long aLong = 1L;
|
||||
|
||||
int i = 1;
|
||||
float f = 3;
|
||||
|
||||
double d = 2;
|
||||
|
||||
assertFalse(aIntegerType.equals(aLongType));
|
||||
assertTrue(aInt == aLong);
|
||||
|
||||
@@ -35,4 +44,57 @@ public class PrimitiveUndWrapperTest {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void standardType() {
|
||||
typeTest(1);
|
||||
typeTest(2.1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void typeTest(int i) {
|
||||
System.out.println("int");
|
||||
}
|
||||
|
||||
private void typeTest(long i) {
|
||||
System.out.println("long");
|
||||
}
|
||||
|
||||
private void typeTest(float i) {
|
||||
System.out.println("float");
|
||||
}
|
||||
|
||||
private void typeTest(double i) {
|
||||
System.out.println("double");
|
||||
}
|
||||
|
||||
public static void main(String... args) {
|
||||
new PrimitiveUndWrapperTest().stringConcat();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void stringConcat() throws Exception {
|
||||
System.out.println(4 + 3 + "" + 3 + 5);
|
||||
"asdadada".length();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
class Ober {
|
||||
|
||||
ArrayList getList() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
class Unter extends Ober {
|
||||
@Override
|
||||
HeaderList getList() {
|
||||
new Character()
|
||||
super.getList().size()
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user