NEW
Font size
WorksheetsJava Quiz 1: Introduction
Total questions: 10
Worksheet time: 30mins
Which of the following can be used for decimal values?
int
String
long
double
In Java a string is a:
Long strand of thread
A series of objects arranged in a line.
Group of visible symbols contained in "quotes".
A series of objects arranged in a line.
Which of the following is the correct way to create a String in Java?
"Hello, World" = String message;
String message = "Hello, World!";
message = Hello, World!;
String = "Hello, World!"
Which of the following is acceptable as a variable name in Java for int type?
myInt
myint!
4isMyFavoriteInt
my int
What will the following statement display when run?
System.out.println(5+2*4-1);
12
27
5+2*4-1
11
What will the following statements display when run?
String str1="Hello";
String str2="Goodbye";
String str3=str1+str2;
System.out.println(str3+str1);
"str3+str1"
"HelloGoodbyeHello"
"HelloHelloGoodbye"
"Hello GoodBye Hello"
Variable names can start with an underscore.
True
False
Variables are case sensitive.
True
False
Concatenation is the joining of two or more strings in Java.
True
False
In Java variables have to be given a specific type.
True
False
