Following code will result in: class A { int b = 1; public static void main(String [] args) { System.out.println("b is " + b); }}
Compilation error
Runtime Error
Runtime Exception
Output of b is 1
Following code will result in: class A { public static void main(String [] args) {B b = new A(); }} class B extends A {}
Compile error
No error
Rintime Error
Following code will result in: class A { public static void main(String [] args) {A a = new B(); }} class B extends A {}
Compiler error
No errors
If class A implements an interface does it need to implement all methods of that interface?
Yes, always it should implement
No, Never
No, Not when A is abstract
None of the above
The methods wait(), notify() and notifyAll() in Object need to be called from synchronized pieces of code.
true
false
Depends on situation
none of the above
A class cannot be declared
volatile
private
default
static
mainn() { main(); } This loop runs upto???
Infinite loop
Until Stack Underflow
Until Machine Hangs
Stack Overflow
Complexity of Quick Sort????(avg)
O(n2)
O(log n)
O(nlogn)
O(n2 logn)
Complexity Of Bubble Sort..???
O(n)
O(n^2)
O(n log n)
What is the difference between the types double and Double?
double is primitive datatypes. Double is a class
Both are primitive dataType
Both are class type
double is class and Double is primitive Type