Search Header Logo

Java Gate MCQs

Authored by Niyati Pandit

Other

12th Grade

Java Gate MCQs
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

What is the size of the 'int' data type in Java?

6 bytes

8 bytes

2 bytes

4 bytes

2.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

What is the purpose of 'System.out.println()' in Java?

To read input from a file

To calculate mathematical expressions

To create a new object instance

To print output to the console

3.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

How do you read input from the user in Java?

Use the BufferedReader class from java.io package

Use the Scanner class from java.util package

Create a custom input reader class

Directly access System.in stream

4.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

What is the default value of an 'int' variable in Java?

null

1

-1

0

5.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

What is the difference between '==' and '.equals()' in Java?

'==' compares values, '.equals()' compares types

'==' is used for strings, '.equals()' is used for integers

'==' is a method, '.equals()' is an operator

'==' compares reference, '.equals()' compares content

6.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

What is the output of '5 + 3 * 2' in Java?

10

15

7

11

7.

MULTIPLE CHOICE QUESTION

10 mins • 10 pts

What is the 'Scanner' class used for in Java?

The 'Scanner' class in Java is used for taking user input from the console.

The 'Scanner' class in Java is used for drawing graphics on the screen.

The 'Scanner' class in Java is used for connecting to databases.

The 'Scanner' class in Java is used for generating random numbers.

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?