Java Programming Basics

Quiz
•
Computers
•
University
•
Hard
Mahen Jayalath
Used 40+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
What is wrong with the following Java variable declaration?
int 1stNumber = 23;
There is no data type called 'int'
Variable names can not start with a digit
Variable names can not contain digits
Number 23 can not be stored in an int
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following variable declarations are incorrect?
a. float mySalary = 3500.77;
b. int my1stSalary = 2300;
c. double salaryOne = 3450.0f;
d. double salary(1);
a and b
a and d
c and d
b and d
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Following set of data items are to be stored about a student
a. Students name
b. Students current age in years
c. Students weight in kg
d. Students gender
Which of the following data types will match best with these
a. String
b. int
c. String
d. String
a. String
b. float
d. int
d. int
a. String
b. int
c. float
d. boolean
a. String
b. int
c. float
d. char
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following data is the 'smallest' data type that can be used to hold the 'distance between Earth to Mars' in km.
(Average distance between Earth and March is 234,460,000 km)
byte
int
long
short
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statement prints smith\exam1\test.txt?
System.out.println("smith\exam1\test.txt");
b.System.out.println("smith\\exam1\\test.txt");
c.System.out.println("smith\"exam1\"test.txt");
d.System.out.println("smith"\exam1"\test.txt");
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
17. What is the output of System.out.println('z' - 'a')?
25
26
x
Generates and error
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
What is true about the provided code?
count < 100 is always true at Point A
count < 100 is always true at Point B
count < 100 is always false at Point B
count < 100 is always true at Point C
count < 100 is always false at Point C
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
CMP128 Java Ch. 05 Methods

Quiz
•
University
15 questions
Bootcamp Day 3 - Java Array

Quiz
•
University
9 questions
SPB Hfdstk 1 & 1.2

Quiz
•
University
10 questions
Java Quiz 1

Quiz
•
University
11 questions
Linux Commands

Quiz
•
University
15 questions
Code Craft : Java & Web Quiz"

Quiz
•
University
10 questions
Programación II Parte 1

Quiz
•
University
10 questions
Briefing Operator Java

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University