Java Bootcamp Day 4

Java Bootcamp Day 4

University

15 Qs

quiz-placeholder

Similar activities

Chapter 5-1: Review Questions & Exercises

Chapter 5-1: Review Questions & Exercises

University

10 Qs

WAI-Kaggle-Quiz

WAI-Kaggle-Quiz

University

10 Qs

chapter 3 - Network & Security Overview

chapter 3 - Network & Security Overview

University

13 Qs

TES AWAL MODUL 2

TES AWAL MODUL 2

University

10 Qs

Quiz on Misinformation and Bias

Quiz on Misinformation and Bias

10th Grade - University

18 Qs

Round 2 for Preplacement Bootcamp

Round 2 for Preplacement Bootcamp

University

15 Qs

NACOS Kahoot Session II

NACOS Kahoot Session II

University

20 Qs

07 - Map

07 - Map

University

15 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