-
-
-
What is the difference between Abstract class and Interface
Answered by Scott on 2005-05-12 10:03:06: An abstract class can contain non-abstract methods which do not have to be overridden in the subclass. There is no difference between a fully abstract class (all methods declared as abstract and all fields are public static final) and an interface.
-
Predict the output of the given code:
javapublic class Test {
private static String msg = "HCL ";
static{
Thread t = new Thread(new Runnable(){
public void run(){
msg = "Technologies ";
}
});
t.start();
}
public static void main(String[] args){
System.out.print(msg);
}}
a) Compiles and prints HCL
b) Compiles and prints Technologies
c) Compiles and... -
An interface contains _________ methods
Skill/Topic: InheritanceA) AbstractB) Non-abstract C) Implemented D) Un-implemented
-
What is a transient variable
A transient variable is a variable that may not be serialized.
Java Interview Questions
Ans