The OCAJP 8 exam is associate-level programmer certification offered by Oracle. Here is a 'Java SE 8 Programmer OCA Exam quiz' that will help you prepare for this exam. So, if you're planning to appear in the exam, then try this quiz. This exam is easier than OCPJP 8 (next level), and it validates Java language fundamentals. It is one See moreof the most sought-after certifications for aspiring software developers. The quiz below is well designed and will help you revise your concepts. All the best!
Line 6 generates a compiler error.
Line 7 generates a compiler error.
There is no output.
Empty = false, Brand = null
Empty = false, Brand =
Rate this question:
Bunny is a class.
Bun is a class.
Main is a class.
Bunny is a reference to an object.
Bun is a reference to an object.
Main is a reference to an object.
None of the above.
Rate this question:
An instance variable of type int defaults to null.
An instance variable of type String defaults to null.
An instance variable of type double defaults to 0.0.
An instance variable of type int defaults to 0.0.
None of the above.
Rate this question:
Private static void main(String[] args)
Public static final main(String[] args)
Public void main(String[] args)
Public static void main(String[] args)
Public static main(String[] args)
None of the above.
Rate this question:
Line 4 generates a compiler error.
Line 5 generates a compiler error.
Line 6 generates a compiler error.
Line 7 generates a compiler error.
Line 8 generates a compiler error.
Line 9 generates a compiler error.
The code compiles as is.
Rate this question:
Java BirdDisplay Sparrow Blue Jay
Java BirdDisplay Sparrow "Blue Jay"
Java BirdDisplay Blue Jay Sparrow
Java BirdDisplay "Blue Jay" Sparrow
Java BirdDisplay.class Sparrow "Blue Jay"
Java BirdDisplay.class "Blue Jay" Sparrow
Does not compile.
Rate this question:
If String result = "done"; is inserted on line 2, the code will compile.
If String result = "done"; is inserted on line 4, the code will compile.
If String result = "done"; is inserted on line 6, the code will compile.
If String result = "done"; is inserted on line 9, the code will compile.
None of the above changes will make the code compile.
Rate this question:
A$B
_helloWorld
. true
. java.lang
Public
1980_s
Rate this question:
Package my.directory.named.a;
Package my.directory.named.A;
Package named.a;
Package named.A;
Package a;
Package A;
Does not compile.
Rate this question:
0
4
Compilation fails on line 3.
Compilation fails on line 4.
Compilation fails on line 7.
Compilation fails on line 8.
Rate this question:
Int i1 = 1_234;
Double d1 = 1_234_.0;
Double d2 = 1_234._0;
Double d3 = 1_234.0_;
Double d4 = 1_234.0;
None of the above.
Rate this question:
Import aquarium.*;
Import aquarium.*.Jelly;
Import aquarium.jellies.Jelly;
Import aquarium.jellies.*;
Import aquarium.jellies.Jelly.*;
None of these can make the code compile.
Rate this question:
Lambda expressions can only be used with interfaces that have more than one abstract method.
Lambda expressions can access only final variables from the enclosing scope.
Lambda expressions can be used to create instances of functional interfaces.
Lambda expressions are not allowed to throw checked exceptions.
Rate this question:
String[] _names
String[] 123
String abc[]
String _Names[]
String... $n
String names
None of the above.
Rate this question:
Java allows operator overloading.
Java code compiled on Windows can run on Linux.
Java has pointers to specific locations in memory.
Java is a procedural language.
Java is an object-oriented language.
Java is a functional programming language.
Rate this question:
A local variable of type float defaults to 0.
A local variable of type Object defaults to null.
A local variable of type boolean defaults to false.
A local variable of type float defaults to 0.0.
None of the above.
A, B, C
B, C, A
C, B, A
B, A
C, A
A, C
A, B
Rate this question:
Finalize() is guaranteed to be called.
Finalize() might or might not be called
Finalize() is guaranteed not to be called.
Garbage collection is guaranteed to run.
Garbage collection might or might not run.
Garbage collection is guaranteed not to run.
The code does not compile.
Rate this question:
X = 5, y = 11, z = 5
X = 6, y = 10, z = 5
X = 6, y = 11, z = 10
X = 5, y = 10, z = 10
Compilation error
Rate this question:
Javac compiles a .class file into a .java file.
Javac compiles a .java file into a .bytecode file.
Javac compiles a .java file into a .class file.
Java takes the name of the class as a parameter.
Java takes the name of the .bytecode file as a parameter.
Java takes the name of the .class file as a parameter.
Rate this question:
Quiz Review Timeline (Updated): Aug 20, 2024 +
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.