QUIZ-5 static, String and StringBuffer
Quiz
•
Computers
•
Professional Development
•
Practice Problem
•
Hard
RAMESH ADAVELLI
Used 17+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
The keyword "static" in Java is used with
Method
Block
Variable
All the Above
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following variable is declared as static?
Home address of a particular Student
Account number of a Customer
Company name of all Employees in an Organization
Name of a Employee
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet?
public class Demo
{
public static void main(String[] args)
{
System.out.println("Done ");
}
static
{
System.out.print("Hi ");
}
static
{
System.out.print("Well ");
}
}
Done Hi Well
Hi Well Done
Well Done Hi
Done Well Hi
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
public class Demo
{
public void show(int a)
{
System.out.println(a);
}
public static void main(String[] args)
{
show(20);
}
}
20
No Output Displayed
a constant is passed as argument
Compile Time Error
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is not a correct statement?
A class can have any number of static blocks
Static method is accessed directly using class name
Separate memory is allocated for each object for all static variables
Static method is executed before main() method once a class is loaded
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Static variables belongs to an Object?
Yes
No
7.
MULTIPLE CHOICE QUESTION
2 mins • 1 pt
What is the output of the following code?
public class Demo
{
static int x=10;
int y =15;
public Demo()
{
x++;
y++;
}
public static void main(String[] args)
{
Demo d1= new Demo();
Demo d2= new Demo();
Demo d3= new Demo();
System.out.println(d3.x + " , " +d3.y);
}
}
13,15
13,16
13,18
10, 18
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
15 questions
Python Class 1
Quiz
•
Professional Development
16 questions
Linux Basics
Quiz
•
Professional Development
20 questions
MS-900 Cloud Concepts 1
Quiz
•
Professional Development
20 questions
Pemodelan Perangkat Lunak
Quiz
•
Professional Development
20 questions
Mobile and Operating Systems
Quiz
•
Professional Development
20 questions
Basic 2 Python
Quiz
•
12th Grade - Professi...
15 questions
Aggregation, Date & Time Functions Quiz
Quiz
•
Professional Development
17 questions
Lección1 - JavaScript
Quiz
•
1st Grade - Professio...
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
9 questions
FOREST Community of Caring
Lesson
•
1st - 5th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
14 questions
General Technology Use Quiz
Quiz
•
8th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
19 questions
Thanksgiving Trivia
Quiz
•
6th Grade
