QUIZ-5 static, String and StringBuffer

QUIZ-5 static, String and StringBuffer

Professional Development

20 Qs

quiz-placeholder

Similar activities

Introduction to Computing_1

Introduction to Computing_1

4th Grade - Professional Development

17 Qs

Chapter 2: The Internet, the Web, and Electronic Commerce

Chapter 2: The Internet, the Web, and Electronic Commerce

Professional Development

20 Qs

C

C

Professional Development

20 Qs

Quiz on C++_1

Quiz on C++_1

Professional Development

20 Qs

Lamda kifejezések C# nyelven 1.

Lamda kifejezések C# nyelven 1.

Professional Development

17 Qs

SPARK FIDDLE

SPARK FIDDLE

Professional Development

20 Qs

Basics of programming - Quiz - 01

Basics of programming - Quiz - 01

University - Professional Development

20 Qs

C Language Quiz-1

C Language Quiz-1

University - Professional Development

15 Qs

QUIZ-5 static, String and StringBuffer

QUIZ-5 static, String and StringBuffer

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

RAMESH ADAVELLI

Used 17+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?