Looks like no one added any tags here yet for you.
If the source code is compiled by a java compiler, what is the output?
Byte code and .class file
Programming style is important because
a program with proper style is easy to debug for errors, a program is more readable with proper style
To exit a loop and move directly on to the next iteration of the loop which is an appropriate command to use
continue
Which of the following is not a type of loop
for while (for, do while, and while are real)
Which of the following are part of a class interface
method signatures, class javadoc comments
What type should a method that prints a string to the console be?
public void methodName()
Encapsulation divides a class into which 2 of the following?
implementation, interface
What is the default constructor in a java class
the constructor defined with no parameters, a constructor that is provided to us by java when no other constructor is defined
What is the purpose of defining and using a constructor?
to provide an object with initial values, to instantiate an object
Which of the following would be appropriate for generating a random number for a 20 sided die (values 1-20)
int d20 = (int)(20.0 * Math.random()) +1;
You can overload a method by changing
type of parameters, number of parameters
A class variable that can be accessed without the need of instantiating an object is a
static
Consider the following array-
Int[] a = new int[22];
What is the last index of a?
a.length-1, 21
Which of the following are true about arrays
arrays must have a declared size in order to be used, it is ok to waste element 0
When creating a method that takes an array as a parameter we must
ensure the method can deal with any size array
If you declare an array int[] list = [20,2,15,7], the value at the lowest index is:
20
The search algorithm that looks through each element in an array in order, until a result is found is called:
sequential search
What is a reference type
A reference to data stored in memory or a variable that holds a memory address as its value
Are class objects reference types
yes
Are primitive types such as int and double reference types
no
Which of the following is not true when encapsulating a class definition?
We should make helping methods that are only to be called by other methods Public
The job of accessor and mutator methods are:
to set and get the values of Private instance variables