多选题Given:
2. class SafeDeposit {
3. private static SafeDeposit singleton;
4. public static SafeDeposit getInstance(int code) {
5. if(singleton == null)
6. singleton = new SafeDeposit(code);
7. return singleton;
8. }
9. private int code;
10. private SafeDeposit(int c) { code = c; }
11. int getCode() {return code; }
12. }
13. public class BeSafe {
14. // insert lots of code here
25. }
Which are true? (Choose all that apply.)
多选题在一个查询语句的哪些子句中可以使用替代变量?
多选题Given:
3. public class RediMix extends Concrete {
4. RediMix() {System.out.println("r "); }
5. public static void main(String[] args) {
6. new RediMix();
7. }
8. }
9. class Concrete extends Sand {
10. Concrete() {System.out.print("c ");
11. private Concrete(String s) { }
12. }
13. abstract class Sand {
14. Sand() {System.out.print("s "); }
15. }
What is the result?