Pearlox Corp.
Java 6 Test
Abc
Def
Abcabc
Abcdef
Defabc
The member variable called size
The member variable called length
The method size() returns the number of characters.
The method length() returns the number of characters.
The method getSize() returns the number of characters.
ValueOf
IntValue
GetInt
GetInteger
ToInt
Distinct
Synchronized
Volatile
Goto
Construct
8
16
32
64
128
Collection
Set
List
Map
HashMap
Arrays in Java are objects.
It is not possible to assign one array to another.
Array elements are indexed from 1 to size of the array.
If a method tries to access an array element beyond its range, a compile warning is generated.
Arrays size must be specified at creation time.
One two three
One
One two
Compile error.
None of the above
One two three
One
Two
Three
Compile error.
Cannot make a static reference to the non-static method method1.
Compile error method main is not correct
Compile error method method1 is not correct
Method1 must be declared with String not String...
This code compiles and run without errors.
Error, Variable i may not have been initialized
0
1
Null
None of the above
1
Error vest is referenced before it is initialized
2
Error: size of array must be defined
None of the above
Error: anar is referenced before it is initialized
Null
0
5
4
0 1 2 3 4 is printed
Compile error, arr is used before it is initialized
Compile error, Test must be declared abstract
ArrayIndexOutOfBoundes Exception
None of the above.
One
One, default
One, two, three, default
Default
Two
Default
Default, 20
20, 21
No output is displayed
Compiler error default must be defined last.
Methods cannot be overriden to be more restrictive for example private
Static methods cannot be overloaded
Private methods cannot be overloaded
Abstract methods cannot be overriden in subclasses.
Final methods cannot be overriden in subclasses.
Void method1(int k) throws Exception {}
Void method1(long i)throws Exception {}
void method1(long i){}
Public void method1(int j) throws Exception {}
Public void method1(double d) throws Exception {}
Hon
Ho
On
Runtime Exception is thrown
None of the above
S3=s1 + s2;
S3=s1-s2;
S3=s1 & s2;
S3=s1 && s2
S3=s3 && s4
It will compile fine.
It will not compile.
The code will compile but throws an exception at runtime.
Comipler errors because while cannot take a parameter of true.
None of the above.
This program compiles and run fine, but it has no output.
Compiler error, class Testing has no start method
Compiles fine and output 0 followed by 1
Compiles fine but fails at runtime.
Compiler error, class Testing doesnt provide legal override for method run.
Compiler error, static access from non static context.
20 and 40
10 and 40
10 and 20
20 and 20
Set
List
Map
ArrayList
Collection
A value of 0 will be printed to the standard output
Nothing will be printed
Compiler error occured
A Compiler error occured complaining of the scope of variable ii
Runtime exception is thrown.
Public static void Main(String[] args)
Static void main(String args...)
public static void main(String... args)
Public void main(String args)
Public static void main(String arguments[])
B = (boolean) k;
F = d;
D = k;
K = (int)5.5D;
F = 2.8;
Void m1() throws Exception{}
Void m2(int) throw Exception{}
Private m3() {}
Volatile m4() throws IOException{}
Private synchronized void m5() throws Exception {}
True
$a_
1a
A1
_this_is_a_lengthy_variable_name_in_java_
Void method() { }
Int method() { return 0;}
Void method(int i) { }
private void method() { }
Protected void method() { }
Transient
Volatile
Synchronized
Native
Static
For each try block there must be at least one catch block defined
A try block may be followed by any number of finally blocks
A try block must be followed by at least one finally or catch block
If both catch and finally blocks are defined, catch block must appear before finally
A try block may be defined inside a catch block
The program does not compile as i is not initialized
The program compiles but does not run.
The program compiles and runs but does not print anything
The program prints 0
The program prints 1
The program does not compile as i is not initialized
The program compiles but does not run
The program compiles and runs but does not print anything
The program prints 0
The program prints 1
The code does not compile
The code compiles fine and prints "Object"
The code compiles fine and prints "String"
The code throws an Exception at Runtime
The output cannot be determined
Daemon thread
Kernel thread
User thread
Worker thread
Hyper threaed
Reference object
Primitive object
Mutable object
Immutable object
Oriented object
Geographical
Political
Cultural region
Language
All the above
Using profiler
Using logger
Using debuger
Using sysstat
Using analizer
Private
Public
Protected
Default
Compiletime error at lines 3,4,5
Compiltime error at line 4,5
Compiletime error at line 3
Runtime Exception
None of the above
Compiletime error at lines 1,2,3,4
Compiletime error at line 3
Compiletime error at line 1
Compiletime error at lines 3,4
None of the above
Compiletime error at lines 1,2,3,4,5
Compiletime error at lines 2,3,4,5
Compiletime error at lines 2,3,4
Prints 3
None of the above
Prints: ABC
Prints BC and Runtime Exception
Prints: BCD
Runtime Exception
None of the above
Prints 1,2
Prints 2,0
Prints 2,2
Compile time error
None of the above
Prints one two three
Prints one
Compile time error
Runtime exception
None of the above
LinkedList
TreeMap
HashMap
HashSet
None of the above
Prints object created
Compile time error
Runtime Excepion
None of the above
Prints 0
Compile time error
Runtime exception
None of the above
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.