Java Bootcamp Day 4

Java Bootcamp Day 4

University

15 Qs

quiz-placeholder

Similar activities

JAVA - Arrays

JAVA - Arrays

University - Professional Development

15 Qs

PBO Inheritance Episode 2

PBO Inheritance Episode 2

University

18 Qs

Logika & Pemrograman (ID)

Logika & Pemrograman (ID)

10th Grade - Professional Development

20 Qs

Create a Website 1

Create a Website 1

KG - University

10 Qs

Week 4

Week 4

University

15 Qs

Java Control and Loop -2

Java Control and Loop -2

University

20 Qs

Lenguaje de Definición de Datos

Lenguaje de Definición de Datos

University

18 Qs

Programacion Orientada a Objetos

Programacion Orientada a Objetos

12th Grade - University

10 Qs

Java Bootcamp Day 4

Java Bootcamp Day 4

Assessment

Quiz

Computers

University

Practice Problem

Easy

Created by

Karthick M

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary purpose of inheritance in Java?

Code repetition

Code hiding

Code reuse

Code encryption

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to inherit a class in Java?

implements

inherits

extend

extends

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following inheritance types is not supported directly in Java?

Single

Multilevel

Hierarchical

Multiple (via classes)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the following code:

class Animal {

void makeSound() { System.out.println("Animal sound"); }

}

class Dog extends Animal {

void makeSound() { System.out.println("Bark"); }

}

What will new Dog().makeSound(); output?

Animal sound

Bark

Error

Null

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is achieved by using the super keyword in Java?

Access static members

Access parent class members

Access child class members

Access private members of parent class

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output?

class A {

A() { System.out.print("A "); }

}

class B extends A {

B() { System.out.print("B "); }

}

public class Test {

public static void main(String[] args) {

new B();

}

}

A B

B A

AB

Compilation Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What concept does method overriding support in Java?

Encapsulation

Inheritance

Abstraction

Polymorphism

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?

Discover more resources for Computers