Primitive type that can hold whole numbers, not fractions
What are integers
The method than creates an instance of the class.
What is the constructor?
What is the only keyword in this instance of the Shape class?
Shape shape1 = new Shape();
What is new
You use this when you know how many iterations you want to do.
What is for
for(int i = 0; i < 10; i++)
{
System.out.println("PS2");
}
Primitive data type that holds value based on conditions (only two possible values)
What is boolean
The entire title of the driver method that begins every program.
What is public static void main(String [] args){
The best practice for naming objects.
A for loop header contains: a variable initialization; some condition; and what third part
When comparing Strings, we might use this method instead of the double-equal sign (==)
What is equals
What is the difference between doubles and ints
What is every integer can be a double but not every double can be integer.
The formal names given to the data that gets passed into a method.
What are parameters
What will you write inside the for loop to make the code print numbers divisible by 3 between 1 and 10 (both inclusive)?
What is int i = 1; i <=10; i++
What are the values of x and y respectively, after being swapped
int i = 581377;
int j = 5;
int temp = i;
i = j;
j = temp;
i =5, y = 581377
The smallest primitive data type
What is Char
The class that all objects/classes are derived/inherited from.
What is the object class?
This returns the String representation of an object
What is toString?
public class Test{
public static void main(String[] args){
for(int i = 0; i < 5 ; i++){
System.out.print(i++);
}
}
}
What is 024
The ability to derive a new class from an existing one.
What is Inheritance
The process of converting one data type to another is called
What is casting
What does this method return when called?
public int doubltInt(int x)
{
x / 4;
}
doubleInt(8);
What is an error.
Private and public visibility accords to this law
What is encapsulation
public class Test{
public static void main(String[] args){
for(char c = 'a' ; c < 'd'; c++){
System.out.print(c);
}
}
}
What is abc
The two class + method names that will always be the same.
main class + constructor