Java Quiz 2

Java Quiz 2

University

30 Qs

quiz-placeholder

Similar activities

Module 3 - Security Architecture

Module 3 - Security Architecture

University

25 Qs

Aptitude Competition(FY)

Aptitude Competition(FY)

University

25 Qs

Operating system

Operating system

7th Grade - University

25 Qs

Round 1-S1

Round 1-S1

University

25 Qs

Css-BoxModel

Css-BoxModel

University

25 Qs

Review 32 - Will/going to

Review 32 - Will/going to

University

25 Qs

Atividade sobre Modelos de Processo de Software

Atividade sobre Modelos de Processo de Software

University

25 Qs

Quiz Bootstrap (Fullstack Praktikum)

Quiz Bootstrap (Fullstack Praktikum)

University

25 Qs

Java Quiz 2

Java Quiz 2

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Faimina B S

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

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

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Which of the following statements is a valid declaration of an object that belongs to “MyClass”?


MyClass obj = new MyClass();


MyClass obj = new MyClass;

obj = new MyClass();


new MyClass obj;

2.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

How many objects can be made from a class? 


None, you make classes from objects

one

As many as you want

All of the above

3.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

The ____ method executes first in an application, regardless of where you physically place it within its class.

execute()


main()

start()


run()

4.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

To create an object in java we use the keyword new.


True


False

5.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

<class name><Object name>=new <class name>();

This is syntax of creating ______.

class


object

method


function

6.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

What does the final keyword do in front of a variable 'x' declaration do?


the "final" keyword means a man is taking his final, so do not disturb him.


the "final" keyword means there is only one attribute in the Main class.

The "final" keyword before the declaration of the variable "x" indicates that it is a constant and cannot be modified after its initial assignment.


the "final" keyword before the declaration of the variable "x" indicates that there is only one method() in this class.

7.

MULTIPLE CHOICE QUESTION

45 sec • 2 pts

Which of the following line of codes calls an attribute x within a class, and prints its value?

System.out.println(x());

System.out.println(x);

System.out.println(obj.x)

System.out.println("x");

Create a free account and access millions of resources

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?