== 比较引用的地址equel 比较引用的内容 (Object 类本身除外) String obj1 = new String("xyz"); String obj2 = new String("xyz"); // If String obj2 = obj1, the output will be true if(obj1 == obj2) System.out.printlln("obj1==obj2 is TRUE"); else System.out.println("obj1==obj2 is FALSE");
Java中单例模式定义:“一个类有且仅有一个实例,并且自行实例化向整个系统提供。”public class Singleton { private Singleton() { // do something } private static class SingletonHolder { private static final Singleton INSTANCE = new Singleton();
题目一什么是抽象类A class with no methodsA class with no concrete subclassesA class with at least one undefiend messageNone of above答案是 4 我们是可以定义一个抽象空类的abstract class emptyAb {}题目二abstract class Base{ abstract public void myfunc();