
Java 4C123 2
Quiz
•
Computers
•
Professional Development
•
Medium
Sandeep Tayal
Used 1+ times
FREE Resource
Enhance your content
35 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
what is the output of this question?
class Test1 {
static int x = 10;
public
static void main(String[] args)
{
Test1 t1 = new Test1();
Test1 t2 = new Test1();
t1.x = 20;
System.out.print(t1.x + " ");
System.out.println(t2.x);
}
}
10 10
20 20
10 20
20 10
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of this question?
class Test1 {
static int i = 1;
public static void main(String[] args)
{
for (int i = 1; i < 10; i++) {
i = i + 2;
System.out.print(i + " ");
}
}
}
3 6 9
3 6 9 …. 27
Error
none
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Predict the output of the following program.
class A{
int a=40;//non static
public static void main(String args[]){
System.out.println(a);
}
}
Compilation Error
40
0
None of the above
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
predict the output
Static block
nothing prints
compile time error
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
515
1020
20
30
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
static block can call non static methods with the help of object.
true
false
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
The different between static and non static method is ....
for non static method : user need to create object in a class to call a method.
A method is to perform only specific task.
There is no significant differences between static and non - static method.
Both are bounded with a class.
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
35 questions
Living in the IT Era
Quiz
•
Professional Development
30 questions
Python. Турнир 1
Quiz
•
Professional Development
40 questions
HTML Basics
Quiz
•
Professional Development
30 questions
HTML y CSS
Quiz
•
University - Professi...
40 questions
Data Preprocessing
Quiz
•
Professional Development
35 questions
CHAPTAR-12 MCQ
Quiz
•
Professional Development
30 questions
2º-DAM-Evaluación Inicial-PMU
Quiz
•
Professional Development
35 questions
QUIZ-LATIHAN UJIAN SMT VI
Quiz
•
Professional Development
Popular Resources on Wayground
20 questions
Brand Labels
Quiz
•
5th - 12th Grade
11 questions
NEASC Extended Advisory
Lesson
•
9th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World
Quiz
•
3rd - 12th Grade
10 questions
Boomer ⚡ Zoomer - Holiday Movies
Quiz
•
KG - University
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
Adding Integers
Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns
Quiz
•
3rd Grade
20 questions
Multiplying and Dividing Integers
Quiz
•
7th Grade