-
What is a transient variable
A transient variable is a variable that may not be serialized.
-
An interface contains _________ methods
Skill/Topic: InheritanceA) AbstractB) Non-abstract C) Implemented D) Un-implemented
-
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... -
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.
-
-
-
-
Which of the following is not a wrapper class?
A) StringB) IntegerC) BooleanD) Character
-
-
Is null a keyword
The null value is not a keyword.
-
-
What is the difference between an if statement and a switch statement
The if statement is used to select among two alternatives. It uses a boolean expression todecide which alternative should be executed. The switch statement is used to select among multiple alternatives. It uses an int expression to determine which alternativeshould be executed.
-
-
When to use Interface over abstract class?
Abstract Classes: Classes which cannot be instantiated. This means one cannot make a object of this class or in other way cannot create object by saying ClassAbs abs = new ClassAbs(); where ClassAbs is abstract class.Abstarct classes contains have one or more abstarct methods, ie method body only no implementation.Interfaces: These are same as abstract classes only difference is we an only define...
-
-
Mention 5 basic difference between Array List and Vector in Java Colletion FrameWork.
Vector is unsynchronized wheras ArrayList is synchronized.
-
Java is Architectural _____________
A) DependentB) NeutralC) IndependentD) None of the above
-
_____________ is the process by which one object acquires the properties of another object
A) EncapsulationB) ClassC) InheritenceD) Polymorphism
-
What are the main differences between Java and C++?
Everything is an object in Java (Single root hierarchy as everything gets derived from java.lang.Object). Java does not have all the complicated aspects of C++ ( For ex: Pointers, templates, unions, operator overloading, structures etc..) The Java language promoters initially said "No pointers!", but when many programmers questioned how you can work without pointers, the promoters began saying "Restricted...
-
Which of the following declare an array of string objects? (Select Multiple)
A) String[ ] s;B) String [ ]s:C) String[ s]:D) String s[ ]:
Java Interview Questions
Ans