Can anybody clarify? Thanks in advance.
Q57:
Which of the following statement are true?
1) Adding more classes via import statements will cause a performance overhead, only import classes you actually use.
2) Under no circumstances can a class be defined with the private modifier
3) A inner class may under some circumstances be defined with the protected modifier
4) An interface cannot be instantiated
answer given is 3 and 4.Is 4 correct? I think I can instantiate an interface, like the code of question 50 in the same exam as quoted below:
////////////////////////////////////////
interface IFace{}
class CFace implements IFace{}
class Base{}
public class ObRef extends Base{
public static void main(
String argv[]){
ObRef ob = new ObRef();
Base b = new Base();
Object o1 = new Object();
IFace o2 = new CFace(); //is this an instance?
}
}
/////////////////////////////////