Search Header Logo

Test8

Authored by Prof. Harish T. Gwalani

Computers

University

80 Questions

Test8
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to create an object in Java?

new
class
void
this

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid declaration of an object?

MyClass obj = new MyClass();
obj MyClass = new();
MyClass = obj;
new MyClass obj();

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Static members are shared among:

All instances
One object only
Local classes
None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which method is automatically called when an object is created?

main()
constructor
static
init()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many constructors can a class have?

Only one
Two
Multiple
None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword refers to the current object?

super
this
self
instance

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which modifier makes a member private to its class?

public
protected
default
private

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?