WorksheetsUnit_1_Object Oriented Programming with Java
Total questions: 50
Worksheet time: 38mins
Java was originally named:
New C++
Coffee
Duke
Oak
From where did Java get its name?
Book
Initials of the developers of Java
Coffee
TV Programme
Is Android based on Java?
True
False
When was Java released?
1975
1985
1995
2005
2015
Who invented Java?
Sergey Brin
James Gosling
Steve Jobs
Bill Gates
What was Java originally designed for?
Internet
Consumer electronic devices like TVs, VCRs & toasters etc
Cars
Gaming
Currently which company owns Java?
Microsoft
Oracle
Apple
Intel
Explain JDK
It stands for Java Development Kit
It is the tool necessary to compile, document and package Java programs
Both 1 and 2
None of the above
Explain JRE
It stands for Java Runtime Environment
It stands for Java Root Environment
JRE refers to a runtime environment in which java bytecode can be executed.
None of the above
Explain JVM
It stands for Java Virtual Machine
It is an abstract machine. It is specification that provides run-time environment in which java bytecode can be executed
Both 1 and 2
None of the above
public is a/an
keyword
return type
access modifier
method
static is a/an
keyword
return type
access modifier
method
void is a/an
keyword
return type
access modifier
method
main is a/an
keyword
return type
access modifier
method
main(String[] args) is an
keyword
return type
access modifier
method
" main(String[] args) "
In the above code 'String' is
keyword
class
object
method
Java is 100% Object-oriented Language
True
False
Where does a java program start executing instructions from:
class
source file
main method
object
We are use Scanner Library in java for...
Correcting software errors
Give permissions to the user
Allows the user to write data
Allows the user to enter data
When we want to print in Java, we use the code ......
system.out.print();
System.out.println();
System.Out.Printf();
All of the above
What is at the end of a line of code?
#
;
)
>
What does a comment look like in Java?
\\comment line
#comment line
//comment line
---comment line
How do I insert a multi-line comment?
? Comment lines ?
/* Comment lines */
//Comment lines //
-Java Comment lines -
What value is stored in result if:
int result = 13 - 3 * 6 / 4 % 3;
-5
0
13
-1
12
2 + 3 * 12 / 7 - 4 + 8
5
12
11
-4
9
What are the 4 basic components of a computer system?
Processor, RAM, ROM and the bus
Processor, hard drive, VGA port and USB
Processor, Main Memory, Secondary Memory and I/O
Processor, RAM, I/O and Windows
What is a good example of an input device?
monitor
printer
webcam
speakers
What is a good example of an output device?
headphones
microphone
mouse
keyboard
Which one is NOT the basic element of OOP?
Class
Abstraction
IntelliJ
Polymorphism
Java will ignore whitespace in code.
True
False
What is the purpose of a Java Runtime Environment?
Enables development of Java programs.
Software to help you write programs.
Enables the Execution of java programs.
What is source code?
Running the code starting at the main method.
Checking your code for syntax errors and putting it into a .class file
Code written as a .java file that can be edited in a text editor or IDE
What does it mean to compile code?
Running the code starting at the main method.
Code written as a .java file that can be edited in a text editor or IDE
Checking your code for syntax errors and putting it into a .class file
What does it mean to execute code?
Running the code starting at the main method.
Code written as a .java file that can be edited in a text editor or IDE
Checking your code for syntax errors and putting it into a .class file
What does System.out.print("Exam review") do?
Prints the "Exam Review" to the printer.
Prints "Exam Review" to the terminal followed by a carraige return/enter
Prints "Exam Review" to the terminal and waits on the same line for the next command
Prints "Exam Review" as the next line of code.
What does System.out.println("Exam review") do?
Prints the exam review to the printer.
Prints "Exam Review" to the terminal followed by a carraige return/enter
Prints "Exam Review" to the terminal and waits on the same line for the next command
Prints "Exam Review" as the next line of code.
Which of the following is NOT a relational operator?
<
>
&&
>=
Which of the following is NOT an arithmetic operator?
+
%
/
=
*
In the import statements java.util.Scanner and java.util.Random, what does util stand for?
until
utopias
utensils
utility
Which of the following correctly constructs a Scanner that reads from the terminal window?
Scanner scan = new Scanner();
Scanner scan = new Scanner(System.in);
Scanner scan = new scan();
Scanner scan = new Scanner(System.input);
Assuming you have constructed a scanner named scan, how could you get just the number typed from the user?
scan.next()
scan.nextNumber()
scan.nextInt()
scan.nextLine()
What keyword means that a method returns nothing?
return
parameters
void
public
What keyword denotes the accessibility of the method to other classes?
void
public
parameters
return
What keyword is used to have a method finish execution and send data back to its caller?
void
public
return
parameters
What word means "the data sent to a method"?
void
public
return
parameters
Smallest unit of data that is stored by a computer:
Byte
Binary code
Bit
Character
Type of language that only includes zeros and ones:
Java
HTML
Algebraic language
Machine language
The set of instructions that tell the computer what to do is generally known as:
Hardware
Software
Bits
Information
The rules that must be followed to write a program on a specific computer language are known as:
Grammar
Syntax
Precedence
Directive
An example of application software is:
Mac OS
HTML
Java
Word processor
