This Oracle Certified Java Associate Exam Quiz assesses knowledge in Java programming and its principles. It tests code comprehension, error handling, and understanding of JavaBeans and immutable objects, preparing learners for certification.
None. The code compiles and prints swim!.
None. The code compiles and prints a stack trace.
One
Two
Three
Rate this question:
One
Two
Three
None. It doesnt compile.
None. It throws an exception at runtime.
Rate this question:
Final, package-private
Class, static
Protected, instance
Public, static
Default, public
Rate this question:
One
Two
Three
Four
Five
None. The code does not compile.
Rate this question:
False false false
True true true
False true true
False false true
The code does not compile
Rate this question:
If the file does not contain a package statement, then the compiler considers the classpart of the java.lang package.
The compiler assumes every class implicitly imports the java.lang.* package
The compiler assumes every class implicitly imports the java.util.* package.
Java requires every file to declare a package statement
Java requires every file to declare at least one import statement
If the class declaration does not extend another class, then it implicitly extends the java.lang.Object class.
Rate this question:
Leaves growing
Ing
Wing
The code does not compile
The code compiles but throws an exception at runtime
It only prints Hello
It only prints Goodbye
It only prints See you again.
It does not compile because of line g1
It does not compile because of line g2
None of the above
Rate this question:
X--, ++x
X--, x++
--x, x+
--x, ++x
Rate this question:
None
One
Two
Three
Four
None of the above—this code doesn’t compile.
Rate this question:
Null
Shoelace
Shoelaceshoelace
The code does not compile
This is an infinite loop
The code compiles but throws an exception at runtime.
Rate this question:
Grow!
Growing!
Super Growing!
The code does not compile because of line m1.
The code does not compile because of line m2.
The code does not compile because of line m3.
[]
[0, 01, 1, 10]
[0, 01, 10, 1]
[0, 1, 01, 10]
The code does not compile
The code compiles but throws an exception at runtime.
Rate this question:
I Only
II Only
II only
IV Only
I or II, or both
None of the above
Rate this question:
5
7
8
The code does not compile.
The code compiles but throws an exception at runtime.
Rate this question:
None
One
Two
This is an infinite loop.
The code does not compile.
Rate this question:
6
X
The code does not compile.
The code compiles but throws a NullPointerException at runtime.
The code compiles but throws a different exception at runtime.
The output is not guaranteed.
Rate this question:
/** Insert */ in next method **/
/****** Find the kitty cat */
// Is this a bug?
/ Begin method - performStart() /
/*** TODO: Call grandma ***/
# Updated code by Patti
Rate this question:
Change name to _name
Change 10017 to _10017
Change 10017 to 10017_
Change 10017 to 10_0_17
Change int to _int
Rate this question:
FileNotFoundException
ArithmeticException
IOException
Exception
IllegalArgumentException
RuntimeException
Rate this question:
1234
1234.0
1234.0L
1234l
1234L
1_234
Rate this question:
0 1
1 1
1 2
The code does not compile.
The code compiles but throws an exception at runtime.
Rate this question:
Both right-hand sides of the ternary expression will be evaluated at runtime.
A switch statement may contain at most one default statement
A single if-then statement can have multiple else statements
The | and || operator are interchangeable, always producing the same results at runtime
The ! operator may not be applied to numeric expressions.
Rate this question:
I Only
II Only
II and III
I, III, and IV
I, II, III, and IV
None are true.
Rate this question:
2 2
2 3
3 2
3 3
The code does not compile.
The code compiles but throws an exception at runtime.
Rate this question:
Import static food.Grass.getGrass; import static food.Grass.seeds;
Import static food.*;
Static import food.Grass.*;
Static import food.Grass.getGrass;
Static import food.Grass.seeds;
Import static food.Grass.*;
Rate this question:
Boolean
Short
Int
Byte
Long
Float
Rate this question:
A catch block can never appear after a finally block.
A try block must be followed by a catch block.
A finally block can never appear after a catch block.
A try block must be followed by a finally block.
A try block can have zero or more catch blocks.
A try block can have zero or more finally blocks.
Rate this question:
Forest.Bird
Savana.sand.Wave
Jungle.tree.Huicungo
Java.lang.Object
Forest.Sloth
Forest.ape.bonobo
Rate this question:
Public byte getNose(String nose)
Public void setHead(int head)
Public String getShoulders()
Public long isMouth()
Public void gimmeEars()
Public boolean isToes()
Rate this question:
No objects are eligible for garbage collection.
One object is eligible for garbage collection.
Two objects are eligible for garbage collection.
No objects are guaranteed to be garbage collected
One object is guaranteed to be garbage collected.
Two objects are guaranteed to be garbage collected.
Final int min, max = 100;
Final int min = 0, max = 100
Int min, max = 100;
Int min = 0, max = 100
Static int min, max = 100
Static int min = 0, max = 100;
Rate this question:
____()
%run()
Check-activity()
$Hum2()
Sing\\3()
Po#ut ()
Rate this question:
One
Four
Five
The code does not compile
The code compiles but throws an exception at runtime.
Rate this question:
None
One
Two
Three
Four
Five
Rate this question:
15
It does not compile because of line q1.
It does not compile because of line q2
It does not compile because of line q3.
It does not compile because of line q4.
It compiles but it throws an exception at runtime.
Cars
Cars carts
Ccars arts
The code does not compile.
The code compiles but throws an exception at runtime.
Rate this question:
–,+,=,--
%,*,/,+
=,+,/,*
^,*,-,==
*,/,%,--
Rate this question:
It prints true
It prints false
It doesn't compile due to line k1
It doesn't compile due to line k2
It doesn't compile due to another line.
Rate this question:
Character
Byte
Double
Long
String
Object
Rate this question:
Protected and package-private (blank)
Public and public
Package-private (blank) and protected
Protected and protected
Private and public
Package-private (blank) and package-private (blank)
Rate this question:
Lines 15 and 17
Lines 15, 16, and 21
Line 17
Lines 17, 18, and 20
Line 20
Line 21
Rate this question:
List<String> a = new ArrayList();
List<> b = new ArrayList();
List<String> c = new ArrayList<>();
List<> d = new ArrayList<>();
List<String> e = new ArrayList<String>(); F. List<> f = new ArrayList<String>();
List<> f = new ArrayList<String>();
Rate this question:
Default
Protected
Static
Private
Final
Abstract
Rate this question:
R
E
Ed
Red
The code does not compile
The code compiles but an exception is thrown at runtime.
Rate this question:
The declaration of name does not compile.
The declaration of _number does not compile.
The declaration of profit$$$ does not compile.
The println statement does not compile.
The code compiles and runs successfully.
The code compiles and throws an exception at runtime.
Rate this question:
Public Big(boolean stillIn)
Public Trouble()
Public Trouble(int deep)
Public Trouble(String now, int... deep)
Public Trouble(long deep)
Public Trouble(double test)
Rate this question:
Inheritance is better than using static methods for accessing data in other classes.
Inheritance allows a method to be overridden in a subclass, possibly changing the expected behavior of other methods in a superclass.
Inheritance allows objects to inherit commonly used attributes and methods
It is possible to create a Java class that does not inherit from any other
Inheritance tends to make applications more complicated.
Rate this question:
Quiz Review Timeline (Updated): Jan 22, 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.