byte b; final int a = 10; final int x = a; b = x; System.out.println("The value of b is " + b);
Compilation error
Runtime Error
10
None of these
Which one of these statements are valid? Char \u0061r a =’a’; Char \u0062 = ’b’; Char c =’\u0063’Which one is not correct A. x = = Float.NaN B. Float.isNan(x); C. Myobject .equals(float.NaN);
A
B
C
All
static methods can be overridden. True/False
True
False
main method can be overridden.. True/False
Which one is not correct A. x = = Float.NaN B. Float.isNan(x); C. Myobject .equals(float.NaN);
Both
Which is true about overloading?
return type should be different
access speciifer should be different
arguments should be different
the overloaded methods should throw a different excpetion
What is the rule regarding overriding methods throwing exceptions?
Overriding method can not throw more generic exception than base method
Overriding method can throw new or broader checked exceptions
None of the above
Both a and b
println exhibits which type of polymorphism
Overloading
Overriding
Both 1 and 2
Dynamic polymorphism
void main() { unsigned int x=-1; int y; y = ~0; if(x == y) printf("same"); else printf("not same"); }
not same
same
unknown symbol ‘~’
none of the above
f1(int c) { printf("%d", c); } void main() { int a=1; f1(a++); }
0
1
2
3