java 13-10-2023

java 13-10-2023

Professional Development

15 Qs

quiz-placeholder

Similar activities

Java Fundamentals

Java Fundamentals

Professional Development

20 Qs

AP Computer Science Unit 2

AP Computer Science Unit 2

Professional Development

20 Qs

JAVA QUIZ

JAVA QUIZ

Professional Development

11 Qs

java

java

Professional Development

10 Qs

for loops & while loops

for loops & while loops

University - Professional Development

10 Qs

Quiz Java héritage

Quiz Java héritage

Professional Development

10 Qs

DOT NET-SET1

DOT NET-SET1

Professional Development

15 Qs

VCE TalentNext-2021 Quiz-2

VCE TalentNext-2021 Quiz-2

Professional Development

20 Qs

java 13-10-2023

java 13-10-2023

Assessment

Quiz

Computers

Professional Development

Medium

Created by

DEVAKI AMIR

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct identifier for a method name in Java.

1show

$hide

*show$

3_click

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of any Logical operation in Java?

1 or 0

true or false

char or String

None of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The method parameters can be redeclared in the method body

true

false

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

The private member of a class can be accessible


a) Within the class in which it is declared

b) Within all the sub-classes of its class in any package where this class is visible

c) Within all the classes in the package containing its class

both a and b

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

class c
{
private static int p1=20;
protected static int p2=40;

protected static int func1() {
return p1;
}
}

class testClass extends c{

protected static int func2() {
return p2+func1();
}

public static void main(String[] args ) {
System.out.println(func2());
}
}

60

Compilation error- The field c.p1 is not visible

40

0

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Check the below code and state whether it is called Recursion in Java?

void methodA()

{ methodB(); }

void methodB()

{ methodA(); }

TRUE

FALSE

Answer explanation

Explanation:

No, not at all. In the above code, the first method calls the second method and the second method calls the first method. 

7.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

public class RecursionTesting {

static int num=4;

public static void main(String[] args) {

new RecursionTesting().recursiveMethod(); }

void recursiveMethod() {

num--;

if(num == 0)

return;

System.out.print(num + " ");

recursiveMethod(); } }

4 3 2 1

3 2 1

3 2 1 0

Compiler error

Answer explanation

Note that this recursive method does not return anything. It simply does the printing of some values.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?