JAVA QUIZ

Quiz
•
Computers
•
Professional Development
•
Hard
DEEPA PRABHU.R
Used 54+ times
FREE Resource
11 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the outoput?
class Test {
protected int x, y;
}
class Main {
public static void main(String args[]) {
Test t = new Test();
System.out.println(t.x + " " + t.y);
}
}
0 0
no output
error
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output?
class Test
{
public static void main(String[] args)
{
for(int i = 0; 1; i++)
{
System.out.println("Hello");
break;
}
}
}
error
Hello
no output
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
•Which of the following is a valid declaration of an object of class Box?
a) Box obj = new Box();
b) Box obj = new Box;
c) obj = new Box();
d) new Box obj;
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
class main_class
{
public static void main(String args[])
{
int x = 9;
if (x == 9)
{
int x = 8;
System.out.println(x);
}
}
}
•a) 9
b) 8
c) Compilation error
d) Runtime error
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
class box
{
int width;
int height;
int length;
}
class mainclass
{
public static void main(String args[])
{
box obj1 = new box();
box obj2 = new box();
obj1.height = 1;
obj1.length = 2;
obj1.width = 1;
obj2 = obj1;
System.out.println(obj2.height);
}
}
•a) 1
•b) 2
•c) Runtime error
•d) Garbage value
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
•Which of the following is not a Java features?
•Dynamic
•Architecture Neutral
•Use of pointers
•Object-oriented
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
public class Test
{
public static void main(String[] args)
{
int temp = 40;
if(temp == 30 && temp/0 == 4)
{
System.out.println(1);
}
else
{
System.out.println(2);
}
}
}
a) 1
b) 2
c) Runtime Exception of java.lang.ArithmeticException
d) Compilation error due to divisibility by 0
Create a free account and access millions of resources
Similar Resources on Wayground
9 questions
PreTrainingJavaScript

Quiz
•
Professional Development
12 questions
DBMS-Transactions-Revision

Quiz
•
Professional Development
10 questions
Java Increment & Decrement Operators

Quiz
•
Professional Development
15 questions
DOT NET-SET1

Quiz
•
Professional Development
10 questions
Java main() and Scanner

Quiz
•
Professional Development
11 questions
java 11-10-2023

Quiz
•
Professional Development
10 questions
IT A OOPs Lab Quiz1

Quiz
•
Professional Development
15 questions
java 13-10-2023

Quiz
•
Professional Development
Popular Resources on Wayground
55 questions
CHS Student Handbook 25-26

Quiz
•
9th Grade
10 questions
Afterschool Activities & Sports

Quiz
•
6th - 8th Grade
15 questions
PRIDE

Quiz
•
6th - 8th Grade
15 questions
Cool Tool:Chromebook

Quiz
•
6th - 8th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
3rd Grade
20 questions
Bullying

Quiz
•
7th Grade
18 questions
7SS - 30a - Budgeting

Quiz
•
6th - 8th Grade
Discover more resources for Computers
11 questions
All about me

Quiz
•
Professional Development
10 questions
How to Email your Teacher

Quiz
•
Professional Development
5 questions
Setting goals for the year

Quiz
•
Professional Development
11 questions
complex sentences

Quiz
•
Professional Development
8 questions
Ötzi the Iceman: A 5,000-Year-Old True Crime Murder Mystery | Full Documentary | NOVA | PBS

Interactive video
•
Professional Development
1 questions
Savings Questionnaire

Quiz
•
6th Grade - Professio...
6 questions
Basics of Budgeting 7

Quiz
•
6th Grade - Professio...
20 questions
Movies

Quiz
•
Professional Development