AD_Java Basics

AD_Java Basics

Professional Development

14 Qs

quiz-placeholder

Similar activities

IT Literacy Challenge

IT Literacy Challenge

Professional Development

13 Qs

PYTHON ::04

PYTHON ::04

University - Professional Development

17 Qs

Soal Tentang RAM

Soal Tentang RAM

Professional Development

15 Qs

PYTHON VOCABULARY

PYTHON VOCABULARY

Professional Development

10 Qs

Minecraft Bedwars

Minecraft Bedwars

1st Grade - Professional Development

10 Qs

Mind Exercise

Mind Exercise

Professional Development

10 Qs

Aplicativos Servicios Virtuales Bancolombia y  Konecta

Aplicativos Servicios Virtuales Bancolombia y Konecta

Professional Development

19 Qs

11142020_A+_Lesson_5_Quiz

11142020_A+_Lesson_5_Quiz

Professional Development

10 Qs

AD_Java Basics

AD_Java Basics

Assessment

Quiz

Computers

Professional Development

Practice Problem

Hard

Created by

ARTHI C1514

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

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

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Predict the output

int x = 10;

if (x = 20) {

System.out.println("True");

} else {

System.out.println("False");

}

True

False

Compilation Error

Runtime error

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

for (int i = 0; i < 5; i++);

{

System.out.println("Hello");

}

How many times does "Hello" print?

0 times

1 time

5 times

Compilation error

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Predict the output:
public class Test {

static public void main(String[] args) {

System.out.println("Executed");

}

}

Error – Invalid main method

Executes and prints "Executed"

Error – Missing return type

JVM throws exception

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Predict the output:

public class Demo {

public static void main(String args) {

System.out.println("Run");

}

}

Prints "Run"

Compilation error

Runs but no output

JVM error: main method not found

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Predict the output:
class A {

int x = 10;

}

class B extends A {

int x = 20;

}

public class Test {

public static void main(String[] args) {

A obj = new B();

System.out.println(obj.x);

}

}

10

20

Compilation error

Runtime error

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Predict the output:
class Parent {

private void show() {

System.out.println("Parent");

}

}

class Child extends Parent {

void show() {

System.out.println("Child");

}

}

public class Main {

public static void main(String[] args) {

Parent p = new Child();

p.show();

}

}

Prints "Child"

Prints "Parent"

Compilation error

Runtime error

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Predict the output:
int arr[] = new int[5];

System.out.println(arr[0]);

0

Garbage value

Compilation error

Runtime error

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?