Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

CF1 Hardware and Intro to Java

Total questions: 75

Worksheet time: 37mins

Name
Class
Date
1.

Name the data type that can store: "true"

a)

boolean

b)

char

c)

String

d)

double

2.

Name the data type that can store: 1.0

a)

double

b)

int

c)

char

d)

boolean

3.

(a)   Name = 120;

4.

(a)   number = "12345";

5.

(a)   .out.println();

6.

(a)   name = "ARMY";

7.

(a)   number = 10;

8.

Is the below program correct to print "Hello World"

a)

True

b)

False

9.

What is the value of b after this code segment?

int a = 4;

int b = a++;

a = a * 2;

b /= 2;

a)

2

b)

4

c)

5

d)

8

10.

What is the value of b after this code segment?

int a = 4;

int b = a++;

a = a * 2;

b /= 2;

a)

2

b)

4

c)

5

d)

8

11.

int x = 4;

x *= 10;

Which is true?

a)

x is now 40

b)

x is now 10

c)

x is still 4

d)

x is now 14

12.

int a = 5;

a--;

What is a now?

a)

4

b)

3

c)

5

d)

6

13.

int a = 5;

a++;

What is a now?

a)

4

b)

7

c)

5

d)

6

14.

int a = 7;

int b = 2 + a;

a)

b = 9

b)

b = 2

c)

b = 7

d)

b = 5

15.

6 % 4

a)

4

b)

6

c)

2

d)

3

16.

4 % 6

a)

4

b)

6

c)

2

d)

3

17.

What will be the Output of the below code:

public class Demo{

public static void main(String[] args){

}

}

a)

a) Nothing

b)

b) Error

c)

C) Finite

d)

d) Hii

18.

Which operator is used to add together two values?

(a)  

19.

How do you create a variable with a numeric value 5. where the name of the variable is x.

(a)  

20.

How do you write a Single Liner Comment in Java?

(a)  

21.

What is the correct syntax to output "HelloWorld" in Java?

(a)  

22.

The value of a string variable can be surrounded by single quotes.

a)

true

b)

false

23.

Java is short for "JavaScript".

a)

true

b)

false

24.

How do you insert COMMENTS in Java code?

a)

# This is a comment

b)

/* This is a comment

c)

// This is a comment

25.

How do you create a variable with the numeric value 5?

a)

float x = 5;

b)

x = 5;

c)

int x = 5;

d)

num x = 5

26.
An object is an instance of a:
a)
parameter
b)
method
c)
class
d)
application
27.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
28.

Which of the following primitive data type is a 1-bit and has only two values: true and false

a)

char

b)

string

c)

int

d)

boolean

29.

True or False : Java is case sensitive, which means identifier Hello and hello would have different meaning in Java

a)

True

b)

False

30.

What data type is classified as a sequenced of characters with double quotes.

a)

Char

b)

String

c)

boolean

d)

Float

31.

It is an optional statement used to describe what a program or a line of program is doing.

a)

tag

b)

command

c)

code

d)

comment

32.

Which of the followings is Java code that starts from the main() method as a mandatory part of every program

a)

public void static main(String args [])

b)

public void main static (args[] String)

c)

public static void main (String args[])

d)

public static void main [String [] Args]

33.

Which of this command has errors? Select multiple

a)

System.out.print("Hello World")

b)

System.out.print(Hello World);

c)

System.out.Print("Hello World);

d)

System.out.print("Hello World");

34.

Int data types represents _______ bits.

a)

8

b)

16

c)

32

d)

64

35.

Main() method is not mandatory for a Java program

a)

True

b)

False

36.

_________ operator returns the remainder after division

a)

+

b)

/

c)

%

d)

*

37.

Which declaration will throw an error?

a)

double num = 8;

b)

int averageGrade = 89.7;

c)

boolean done = false;

d)

String done = "true";

38.

A variable that holds true or false

a)

String

b)

boolean

c)

int

d)

float

e)

Alex Trebek

39.

A variable that holds words

a)

String

b)

boolean

c)

int

d)

float

e)

A dictionary

40.
A variable that holds a whole number
a)
String
b)
boolean
c)
int
d)
float
41.

Name the data type that can store: 5

a)

int

b)

char

c)

String

d)

None of the above

42.

What prints out "I love Java" successfully?

a)

System.out.println(I love Java);

b)

Systemoutprintln("I love Java);

c)

System.out.println("I love" + " Java");

d)

System.out.println("I love Java")

43.

What data type would you use for storing the number of students in a class?

a)

boolean

b)

String

c)

double

d)

int

44.

What data type would you use for storing the average test score in a class?

a)

double

b)

String

c)

int

d)

char

45.

What data type would you use for storing letter grades (without - or +) for students in a class?

a)

String

b)

char

c)

int

d)

boolean

46.

What data type would you use to store names of students?

a)

String

b)

char

c)

boolean

d)

None of these

47.

How would you declare and initialize a variable storing a person's name?

a)

string name = "Jeff";

b)

name String = "Jeff";

c)

String name = Jeff;

d)

String name = "Jeff";

48.

How would you declare and initialize a variable storing the tax rate?

a)

int taxRate = 5.1;

b)

taxRate = "5.1";

c)

double taxRate = 5.1;

d)

double taxRate = "5.1";

49.

The physical elements that make up a computer or electronic system and everything else involved that is physically tangible is called what?

a)

Hardware

b)

Software

c)

Network

d)

Extension

50.

Which of the following are examples of hardware?

a)

Keyboard

b)

Plants vs Zombies

c)

Monitor

d)

Mouse

51.

Which of the following is not an example of hardware?

a)
b)
c)
d)
52.

It refers to the applications or programs you use while working on the computer.

a)

Peopleware

b)

Hardware

c)

Software

53.

What component helps draw air out of the computer case to prevent overheating?

a)

Case Fan

b)

Anti-Static Vacuum

c)

Antifreeze

d)

Aixiliary Fan

54.

The component that is used to display the computer image on.

a)

Video Card

b)

RAM

c)

Monitor

d)

Windows

55.

The device on which all of the major internal components are attached is called?

a)

Hard Disk

b)

ROM

c)

Microprocessor

d)

Motherboard

56.

This component processes data if you want to see or record images.

a)

Video Card

b)

Microprocessor

c)

Audio Card

d)

CPU

57.

This device allows a computer to maintain the time and date while unplugged or turned off

a)

Motherboard battery

b)

RAM

c)

CPU

d)

ROM

58.

What does RAM stand for?

a)

Read And Merge

b)

Read Always Memory

c)

Recent Accessed Memory

d)

Random Access Memory

59.

This storage device stores data permanently.

a)

RAM Chip

b)

ROM Chip

c)

Hard Disk Drive

d)

CPU

60.

This is a type of temporary computer memory, what is it called?

a)

ROM

b)

Cloud

c)

RAM

d)

SSD

61.

What does the heat-sink do?

a)

Warms up water

b)

Uses heat to get the CPU warmed up

c)

Cools off the user

d)

Cools off the CPU

62.

Without this unit, the computer has no electricity to run. . .

a)

Electric cables

b)

Power Supply

c)

IDE Cables

d)

Fan

63.

This device processes data so that you can hear or record sound

a)

Video Card

b)

RAM Chip

c)

Sound Card

d)

Speaker

64.

This allow you to increase your computer's performance by adding additional components

a)

Expansion slots

b)

IDE Cables

c)

Power Cables

d)

Additional slots

65.

This connector allows computers to transfer data to and from components outside of the computer

a)

USB Port

b)

External Port

c)

Memory Port

d)

Printer port

66.

People who play video games or do graphic/3D design often will buy a higher end version of this

a)

RAM

b)

Hard Drive

c)

CPU

d)

Graphics Card

67.

What is a SSD?

a)

Flash Memory

b)

Memory Stick

c)

Hard Drive

d)

Soft Drive

68.
What is this?
a)
Harddrive
b)
Tower
c)
Motherboard
d)
DVD
69.
What are these?
a)
Tower
b)
Motherboard
c)
Harddrive
d)
RAM memory
70.
What is this component called?
a)
Spinning Disk Drive
b)
Optical Disk Drive
c)
Hard Disk Drive
d)
Floppy Disk Drive
71.

CPU stands for

a)

Computer Processor Unit

b)

Central Processing Unit

c)

Collective Program URL

d)

Computer Programming Unit

72.

A computer hard drive

a)

stores the operating system, applications, and data files such a documents, pictures and music that your computer uses.

b)

is used to watch movies and videos

c)

is an operating system like Windows or Linux

d)

is not needed on a computer

73.

This component allows you to use CDs, DVDs, and Blu-ray discs to listen to music or watch a movie

a)

RAM

b)

Hard drive

c)

OS

d)

Optical drive

74.

Which type of memory, denoted RAM, stores values only when the power is on?

a)

Regular Arbitrary Memory

b)

Rarely Accessible Memory

c)

Readily Accessed Memory

d)

Random Access Memory

75.

A reference to a specific memory location is called ___

a)

an intersection

b)

an address

c)

a ZIP code

d)

a box number