Java Programming Structures

Quiz
•
Computers
•
University
•
Hard
Jeevitha P
Used 61+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How is a single line comment created in Java?
Two backward slashes at the beginning indicate that the line is a comment
Two forward slashes at the beginning indicate that the line is a comment.
A forward slash followed by two asterisks at the beginning indicate that the line is a comment.
A forward slash followed by an asterisk at the beginning indicate that the line is a comment.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be output of below program?
public class Test {
public void main(String[] args) {
int x = 10*20-20;
System.out.println(x);
}
}
Runtime Error
Prints 180
Prints 0
None of the above
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
class Main {
public static void main(String args[]) {
int t;
System.out.println(t);
}
}
What is the output?
0
Garbage Value
Compiler Error
Runtime Error
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output of following Java Program
class Test {
public static void main(String args[])
{ int x = -4;
System.out.println(x>>1);
int y = 4;
System.out.println(y>>1); } }
Compiler Error: Operator >> cannot be applied to negative numbers
-2
2
2
2
0
2
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which one of the following is NOT a correct variable name?
2bad
zero
theLastValueButOne
year2000
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the need to mention "static" before main method?
To call main method without creating an object of class
To make main method as class method common to all instances
Both A and B
None of the above
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose a correct version of Java Documentation Comment?
/*
comments
*/
/**
comments
*/
/*
comments
**/
/**
comments
**/
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
String args[] in main method are used for?
public static void main(String args[])
{
//
}
Passing arguments at compile time
Passing arguments at run time
Counting number of words
Nothing
9.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Choose a multiline comment in Java language below?
/*comments are going
cars are moving*/
*/comments are going
cars are moving/*
//comments are going
cars are moving//
None of the above
Similar Resources on Wayground
8 questions
11-07 Output in Java

Quiz
•
9th Grade - University
12 questions
javaquizvivek

Quiz
•
University
10 questions
Java Control Flow statements

Quiz
•
University
9 questions
Passaggio parametri

Quiz
•
University
7 questions
Quiz on Java Operators

Quiz
•
University
13 questions
OOP evaluation

Quiz
•
University
10 questions
Python Basics

Quiz
•
University
10 questions
Apps Script Quiz - Day 1 Lesson

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University