Primitive Data Types
Classes
Objects
Loops
Coding Problems
100

Primitive type that can hold whole numbers, not fractions

What are integers

100

The method than creates an instance of the class.

What is the constructor?

100

What is the only keyword in this instance of the Shape class?


Shape shape1 = new Shape();

What is new

100

You use this when you know how many iterations you want to do.

What is for

100

for(int i = 0; i < 10; i++)

{

     System.out.println("PS2");

}

200

Primitive data type that holds value based on conditions (only two possible values)

What is boolean

200

The entire title of the driver method that begins every program.

What is public static void main(String [] args){

200

The best practice for naming objects.

What is lowerCamelCase.
200

A for loop header contains: a variable initialization; some condition; and what third part

What is incrementation/decrementation
200

When comparing Strings, we might use this method instead of the double-equal sign (==)

What is equals

300

What is the difference between doubles and ints

What is every integer can be a double but not every double can be integer.

300

The formal names given to the data that gets passed into a method.

What are parameters

300

The parameter for all objects of the Scanner class

What is System.in

300

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++ 

300

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

400

The smallest primitive data type

What is Char

400

The class that all objects/classes are derived/inherited from.

What is the object class?

400

This returns the String representation of an object 

What is toString?

400

public class Test{    
   
    public static void main(String[] args){
        for(int i = 0; i < 5 ; i++){
            System.out.print(i++);
        }
    }    
}

What is 024

400

The ability to derive a new class from an existing one.

What is Inheritance

500

The process of converting one data type to another is called

What is casting

500

What does this method return when called?

public int doubltInt(int x)

{

x / 4;

}

doubleInt(8);

What is an error.

500

Private and public visibility accords to this law

What is encapsulation

500

public class Test{    

    

    public static void main(String[] args){

        for(char c = 'a' ; c < 'd'; c++){

            System.out.print(c);

        }

    }    

}

What is abc

500

The two class + method names that will always be the same.

main class + constructor