Which of these is not a part of the Java family? - correct answer ✔Java PU
Java may refer to
A programming language
A runtime environment
A virtual machine - correct answer ✔All of the above
Strings are an example of what data type? - correct answer ✔Reference
Strings in Java are null terminated. - correct answer ✔False
It is possible to change a String after it has been created. - correct answer
✔False
You should avoid using == when comparing Strings for equality. - correct
answer ✔True
Which of the following methods removes whitespace from the ends of a
string? - correct answer ✔trim()
,Which of the following methods is typically used to compare two strings? -
correct answer ✔equals()
StringTokenizer is the suggested way of extracting words from strings. -
correct answer ✔False
Which of the following methods returns the words in a string as an array? -
correct answer ✔split()
It is possible to change the contents of an array. - correct answer ✔True
Arrays are a primitive type in Java. - correct answer ✔False
Which is true about passing arrays as arguments to methods? - correct
answer ✔The memory location of the array is copied from the
argument(method call) to the parameter(method signature).
Which of the following notations allows a programmer to pass an arbitrary
number of arguments to a method? - correct answer ✔...
Which of the following is a valid loop? - correct answer ✔for (int value :
values)
Which of the following denotes how to loop over a two dimensional array? -
correct answer ✔for(int i = 0; i < myArray.length; ++i)
for(int j = 0; j < myArray[0].length; ++j)
, Which is the correct way to declare a two dimensional array? - correct answer
✔int[][] myArray
Enumerated types improve readability of if and switch statements. - correct
answer ✔True
An object is the blueprint for a class that defines the data and the behaviors
that a class will have. - correct answer ✔False
What is the purpose of the new keyword? - correct answer ✔To create a new
instance of a class
Variables that belong to an object of a class are called? - correct answer
✔Fields
Which of these is used to initialize an object's data on creation? - correct
answer ✔Constructor
Objects are a user defined type that can be used to create instances called
classes. - correct answer ✔False
Which of the following refers to the principle of not revealing implementation
details to the user of a class? - correct answer ✔Information hiding
Which of the following refers to providing a coherent interface that allows
users of a class to operate on an object's data? - correct answer
✔Encapsulation