NEW
Font size
WorksheetsJava Quiz 2: Classes and Objects
Total questions: 10
Worksheet time: 30mins
In Java null is:
The initial value of an object variable.
A key word
A value that means not pointing to any object
All of these
None of these
In Java an object is:
A key word
A software concept used to model various things in programs, which have states, behaviors and attributes given to them
A primitive data type
None of these
Classes in Java are:
Abstract data types, used as a template of objects
Where students learn
Dungeons and Dragons Character types
None of these
The following string "Hello, World!" is stored in String str.
What will str.indexOf("ll") return?
0
1
2
3
The string method length() returns what?
The size in memory of the string
The number of symbols in a string
How long the biggest word is
A measurement of how long the program has run
When using the indexOf() method, what will be returned when looking for something not contained within the string?
-1
0
1
not found
false
To create an object in java we use the keyword new.
True
False
To assign values to variables in Java we use an equal sign.
True
False
isEmpty() will return true if a string is only contains whitespace.
True
False
We use void to signify that a method does not return any data.
True
False
