========================
Q2:
class Fooo {
public static void main(String args[]) {
int s = 21;
s >>= 10;
System.out.println("s=" + s);//0
}
}
为什么是打印0啊????===================================
Q4:
220. Which of the following are true about encapsulation ? (Select two)
a) Direct access to variables.
b) Access to variables through methods.
c) keeping methods protected.
d) use methods to access and modify the variable data.Ans BD上面是什么意思?
========================
Q5:
ds =(DataSource)ctx.lookup("java:comp/env/jdbc/BookDB");
这里的java:comp/env是在哪里定义的?========================
Q6:
4 Accessing or modifying the slots of null as if it were an array.
5 Throwing null as if it were a Throwable value.
这两句话怎么翻译.
========================
Q7:
test.java内容如下:但报错
public class test {
int i;
test(String s){ }
} class sub extends test {
sub(String s){ }
}
有几道题不是考题 是我平时练习遇到的问题
Q2:
class Fooo {
public static void main(String args[]) {
int s = 21;
s >>= 10;
System.out.println("s=" + s);//0
}
}
为什么是打印0啊????===================================
Q4:
220. Which of the following are true about encapsulation ? (Select two)
a) Direct access to variables.
b) Access to variables through methods.
c) keeping methods protected.
d) use methods to access and modify the variable data.Ans BD上面是什么意思?
========================
Q5:
ds =(DataSource)ctx.lookup("java:comp/env/jdbc/BookDB");
这里的java:comp/env是在哪里定义的?========================
Q6:
4 Accessing or modifying the slots of null as if it were an array.
5 Throwing null as if it were a Throwable value.
这两句话怎么翻译.
========================
Q7:
test.java内容如下:但报错
public class test {
int i;
test(String s){ }
} class sub extends test {
sub(String s){ }
}
有几道题不是考题 是我平时练习遇到的问题
右移10位的二进制形式不就是00000000000000000000000000000000
所以打印出0
2. 通过方法来访问和修改私有数据是封装的表现
所以BD是对的
最后一题应该改成这样就可以了
public class test {
int i;
test(String s){ }
} class sub extends test {
sub(String s){ super(i); }
}
要调用父类的构造函数
int i;
test(String s){ }
} class sub extends test {
sub(String s){ super(s); }
}