Search Header Logo

E5-OOPJ

Authored by Jayanth Babu

Science

University

Used 7+ times

E5-OOPJ
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

var-args means?

variable number of arguments

variety number of arguments

velocity of arguments

volume of arguments

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The purpose of var-args is to

increase length of the code

reduce the readability.

reduce the length of the code

increase number of methods

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

syntax for declaration of var-args method m1()

m1(int, ... x)

m1(int... x)

m1(int...., x)

m1(int x)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

class Test{

static void m1(int... x){

System.out.println("Java Lab");

}

public static void main(String[] args){

m1( );

m1(10);

m1(10,20);

m1(10,20,20);

}

}

What is the output of the program?

java lab

10,20

10,20,30

java lab

java lab

java lab

java lab

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

class Test{

static void sum(int... x){

int total=0;

for(int x1:x){

total=total+x1;

}

System.out.println(" "+total);

}

public static void main(String[] args){

sum( );

sum(10);

sum(10,20);

sum(10,20,30);

}

}

What is the output of the program?

0

0

10

30

60

30

60

60

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

static modifier/keyword is applicable for

only variables

only variables and methods

only methods and all classes

variables

methods

and nested classes

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If we want to create a separate copy for every object, we should go for

instance variable

static variable

object variable

int variable

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?