Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
проект с WebService, собранный JDK7, не запускается на JDK6
@deprecated
import ru.open.haven.client.gui.Test.X.Y;
public class Test {
public static class X {
public static class Y {
public static String Z = "life is good";
}
public static C Y;
}
public static class C {
public static String Z = "life is pain";
}
public static void main(final String[] args) {
System.out.println(Y.Z);
}
}
Unsafe.getUnsafe().throwException(new IOException());Thread.currentThread().stop(new IOException());public class GenericTest
{
public static void main(String[] args)
{
Map<Integer, Long> v = new HashMap<Integer, Long>();
v.put(1, 0L);
Long val = v.isEmpty() ? 0 : v.get(2);
System.out.println(val);
}
}
import java.util.*;
public class GenericTest {
public static void main(String[] args) {
Map<Integer, Long> v = new HashMap<Integer, Long>();
v.put(1, 0L);
if(v.isEmpty()) {
System.out.println(0);
} else {
System.out.println(v.get(2));
}
}
}
import java.util.*;
public class GenericTest {
public static void main(String[] args) {
Map<Integer, Long> v = new HashMap<Integer, Long>();
v.put(1, 0L);
Long val = v.isEmpty() ? Long.valueOf(0) : v.get(2);
System.out.println(val);
}
}
2 «простых» вопроса по джаве