WorksheetsOOP (Object Oriented Programming)
Total questions: 30
Worksheet time: 15mins
Classes make objects. Which 2 objects were created in my program today?
Abstract
Leo
Py
Predator
Classes make
students
objects
Objects are created in a
machine
class
Dog myers = new Dog();
The name of the class is:
Dog
myers
Dog myers = new Dog();
The name of the object being made is:
Dog
myers
Keeping attributes protected in a class
abstraction
inheritance
encapsulation
polymorphism
Deciding what is most important about classes and requiring that. Choosing the methods that are required in all classes.
abstraction
inheritance
encapsulation
polymorphism
When parent or superclasses give their attributes and methods to child or subclasses.
abstraction
inheritance
encapsulation
polymorphism
The same method has different definitions in different classes. This means that the .speak() method will do something different when duck.speak() than dog.speak().
abstraction
inheritance
encapsulation
polymorphism
The average base salary of a Java developer in the USA?
$23,975
$43,975
$63,975
$102,978
Is Android based on Java?
True
False
Which company owns Java?
Oracle
Microsoft
Apple
Intel
Which level of a programming language is Machine Code?
Low
High
Which type of loop iterates until condition become False?
FOR loop
A count-controlled loop
Repeat-once loop
WHILE loop
block comments, which the computer doesn't read, and begin programs with infortion
//
..
/**
*
**/
uppercase letters
comparing two ints
==
this.equals(that)
All cases of a switch statement print if:
you forget break statements
you forget a closing curly bracket
you forget a semicolon
you forget a period
This prints if none of the other cases in a switch statement print:
case final:
case default:
default:
error: case not found
switch(thisWord){
case "word":
case word:
case 'word':
Which two are decision structures?
if-else
for loop
switch
while loop
int a = 2, b = 3, c = 2;
if( a == b || a < c ){
System.out.println(“galaxy”);
}
else{
System.out.println(“comet”);
}
galaxy
comet
nothing
int grade = 98;
grade = grade/10;
switch(grade){
case 9:
System.out.println(“blue group”);
break;
case 8:
System.out.println(“green group”);
break;
default:
System.out.print(“purple group”);
}
What will print?
blue group
green group
purple group
nothing will print
for(int i = 0; i < 4; i++){
System.out.print(i);
}
What will the printout be?
01234
0123
1
2
3
4
0
1
2
3
4
5
