1.1 概述
BAT面试题
- 类文件结构有几个部分?
- 字节码都有哪些?Integer x = 5 ;int y = 5;比较x==y都经过了哪些步骤
public class IntegerTest {
public static void main(String[] args) {
Integer i1 = 10;
Integer i2 = 10;
System.out.println(i1 == i2);//true
Integer i3 = 128;
Integer i4 = 128;
System.out.println(i3 == i4);//false
}
}
public class StringTest {
public static void main(String[] args) {
String str = new String("hello") + new String("world");
String str1 = "helloworld";
System.out.println(str == str1);//false
String str2 = new String("helloworld);
System.out.println(str == str2);//false
}
}
public class SonTest {
public static void main(String[] args) {
Father f = new Son();
System.out.println(f.x);
}
}
class Father {