wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Week 4: Recap Java Programming

Total questions: 10

Worksheet time: 6mins

Name
Class
Date
1.

Which of the following is the correct way to write a class signature? (The line of code to create an application)

a)

public class NameOfApplication{

b)

public class NameOfApplication

c)

public NameOfApplication{

2.

Which of the following is the correct way to declare a variable to store an integer value named num1?

a)

double num1;

b)

int num1;

c)

int double num1;

d)

final int num1;

3.

Fill in the missing blank:

keyboard=________ Scanner(System.in);

a)

space

b)

new

c)

in

d)

keyboard

4.

Which is the correct naming convention for naming an application?

a)

newApplication

b)

NewApplication

c)

newapplication

d)

NEWAPPLICATION

5.

What is the correct naming convention for naming a constant?

a)

constantName

b)

Constantname

c)

ConstantName

d)

CONSTANTNAME

6.

What is the correct naming convention for naming a variable?

a)

VariableName

b)

variableName

c)

VARIABLENAME

d)

variablename

7.

Fill in the missing blank?

num1= (a)   .nextInt();

8.

Which of the following is the correct way to import the Scanner class?

a)

import java.Scanner;

b)

java.util.Scanner;

c)

import java.util.Scanner;

d)

import javax.utily.*;

9.

Which of the following can we use for Grey Pop Up windows?

a)

Scanner

b)

JOptionPane

c)

keyboard

d)

System.out.println

10.

Fill in the missing space:

final ____________ FLOWERCOST=2.33;

a)

double

b)

int

c)

char

d)

String