java quiz on Encapsulation and Abstraction

java quiz on Encapsulation and Abstraction

University

10 Qs

quiz-placeholder

Similar activities

¿Cuánto sabes sobre la tecnología que cambia al mundo?

¿Cuánto sabes sobre la tecnología que cambia al mundo?

University

10 Qs

Constrain Satisfaction Problem (CSP)

Constrain Satisfaction Problem (CSP)

University

10 Qs

Post Test #4 - Python Fundamental #3

Post Test #4 - Python Fundamental #3

University

10 Qs

Data Warehouse - Foundations

Data Warehouse - Foundations

University

10 Qs

GIS Unit III

GIS Unit III

University

15 Qs

Ms. Exel dan Fungsi Logika IF

Ms. Exel dan Fungsi Logika IF

10th Grade - University

15 Qs

SQLite - Writing Queries

SQLite - Writing Queries

University

9 Qs

AB1401 Case Study: Facebook

AB1401 Case Study: Facebook

University

12 Qs

java quiz on Encapsulation and Abstraction

java quiz on Encapsulation and Abstraction

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

shruti keshari

Used 230+ times

FREE Resource

AI

Enhance your content in a minute

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

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which among the following best describes encapsulation?

It is a way of combining various data members into a single unit

It is a way of combining various member functions into a single unit

It is a way of combining various data members and member functions into a single unit which can operate on any data

It is a way of combining various data members and member functions that operate on those data members into a single unit

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If data members are private, what can we do to access them from the class object?

Create public member functions to access those data members

Create private member functions to access those data members

Create protected member functions to access those data members

Private data members can never be accessed from outside the class

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which feature can be implemented using encapsulation?

Inheritance

Abstraction

Polymorphism

Overloading

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which inheritance in java programming is not supported

Multiple inheritance

hierarchal inheritance

Multilevel inheritance

Single inheritance

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is subclass in java?

A subclass is a class that extends another class

A subclass is a class declared inside a class

Both above.

None of the above.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If class B is subclassed from class A then which is the correct syntax

class B:A{}

class B extends A{}

class B extends class A{}

class B implements A{}

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Find which of the following uses encapsulation?

void main(){

int a;

void fun() { int a=10;

System.out.println(a);

fun(); }

class student{

int a;

public int b; };

class student {

int a;

public void disp(){

System.out.println(a);

} }

static topper() {

char name[10];

public int marks; }

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