Automatic conversion between the primitives and the object wrapper class is called
Autounboxing
Autoboxing
polymorphism
encapsulation
consider the following classes. Class A, Class B extends A, Class C extends B. if we instantiate an object, which order the constructor of the above classes get executed?
A,C,B
C,B,A
A,B,C
none of the above
What results from attempting to compile and run the following code? public class Ternary{ public static void main(String args[]){ int a = 5; System.out.println("Value is - " + ((a < 5) ? 9.9 : 9)); } }
9.9
9
9.0
None of the above
What will be the result of executing the following code? 1. boolean a = true; 2. boolean b = false; 3. boolean c = true; 4. if (a == true) 5. if (b == true) 6. if (c == true) System.out.println("Some things are true in this world"); 7. else System.out.println("Nothing is true in this world!"); 8. else if (a && (b = c)) System.out.println("It's too confusing to tell"); 9. else System.out.println("Hey this won't compile");
The code won't compile
Some things are true in this world
Hey this won't compile
The class AssertionError has "is - a" relationship with which of these classes:
RuntimeException
Error
VirtualMachineError
IllegalAccessException
Which of the following uses the same number of bits as the double primitive variable?
int
byte
float
long
If you add int wit a byte , what will be the result?
Int
Byte
Float
float fl = 1.2;
True
False
A program written in the Java programming language can run on any platform because...
Java programming is derived from C++.
The Java Virtual Machine1(JVM) interprets the program for the native operating system.
The compiler is identical to a C++ compiler.
The APIs do all the work.
What is the legal range of a byte integral type?
0 - 65, 535
(-128) - 127
(-32,768) - 32,767
(-256) - 255