
java 4
Quiz
•
Arts
•
1st Grade
•
Hard
Nagendrapatel Puppala
Used 1+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
class Derived
{
protected final void getDetails()
{
System.out.println("Derived class");
}
}
public class Test extends Derived
{
protected final void getDetails()
{
System.out.println("Test class");
}
public static void main(String[] args)
{
Derived obj = new Derived();
obj.getDetails();
}
}
Derived class
Test class
Runtime error
Compilation error
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output?
public class Prg {
public static void main(String[] args)
{
char[] str = { 'i', 'n', 'c', 'l', 'u',
'd', 'e', 'h', 'e', 'l', 'p' };
System.out.println(str.toString());
}
}
includehelp
Error
[C@19e0bfd (Memory Address)
NULL
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
import java.io.IOException;
class Derived
{
public void getDetails() throws IOException //line 23
{
System.out.println("Derived class");
}
}
public class Test extends Derived
{
public void getDetails() throws Exception //line 24
{
System.out.println("Test class");
}
public static void main(String[] args) throws IOException //line 25
{
Derived obj = new Test();
obj.getDetails();
}
}
Compilation error due to line 23
Compilation error due to line 24
Compilation error due to line 25
All the above
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
interface Anonymous
{
public int getValue();
}
public class Outer
{
private int data = 15;
public static void main(String[] args)
{
Anonymous inner = new Anonymous()
{
int data = 5;
public int getValue()
{
return data;
}
public int getData()
{
return data;
}
};
Outer outer = new Outer();
System.out.println(inner.getValue() + inner.getData() + outer.data);
}
}
Compilation error
Runtime error
20
00
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following program?
Java
public class Test
{
static char ch = 59;
public static void main(String[] args)
{
System.out.println(ch);
}
}
compile-time error
null
No output
;
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
class Helper
{
private int data;
private Helper()
{
data = 5;
}
}
public class Test
{
public static void main(String[] args)
{
Helper help = new Helper();
System.out.println(help.data);
}
}
find output??
Compilation error
5
runtime error
none
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following program?
public class Test
{
public static void main(String[] args)
{
double data = 444.324;
int value = data;
System.out.println(data);
}
}
444.324
444
Runtime error
Compilation error
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
20 questions
Week 12 - web security 2
Quiz
•
1st - 5th Grade
20 questions
Test Your School Vocabulary
Quiz
•
1st Grade
21 questions
quizz 2409
Quiz
•
1st Grade
24 questions
прог
Quiz
•
1st - 5th Grade
24 questions
5A 第一課單字
Quiz
•
1st - 5th Grade
25 questions
chapter 7
Quiz
•
1st - 5th Grade
19 questions
Con Art Quiz 1.1
Quiz
•
1st Grade
20 questions
QUIZZIZ MEI 2023
Quiz
•
1st - 5th Grade
Popular Resources on Wayground
20 questions
Halloween Trivia
Quiz
•
6th - 8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Order of Operations
Quiz
•
5th Grade
20 questions
Halloween
Quiz
•
5th Grade
16 questions
Halloween
Quiz
•
3rd Grade
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
20 questions
Possessive Nouns
Quiz
•
5th Grade
10 questions
Halloween Traditions and Origins
Interactive video
•
5th - 10th Grade
Discover more resources for Arts
12 questions
It's The Great Pumpkin Charlie Brown
Quiz
•
1st - 5th Grade
4 questions
What is Red Ribbon Week
Interactive video
•
1st - 5th Grade
10 questions
History of Halloween
Interactive video
•
1st - 5th Grade
18 questions
It's Halloween!
Quiz
•
1st - 4th Grade
20 questions
Place Value
Quiz
•
KG - 3rd Grade
21 questions
Halloween
Quiz
•
KG - 5th Grade
18 questions
Pushes & Pulls
Quiz
•
1st - 4th Grade
28 questions
Halloween Trivia
Quiz
•
1st - 5th Grade
