Search Header Logo

OOPJ- Data Types-Java

Authored by Sarju S

Computers

University

Used 14+ times

OOPJ- Data Types-Java
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

30 sec • 1 pt

What is the size of a double data type in Java?

8 bytes
4 bytes
2 bytes
1 byte

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following can be a valid value for a char data type in Java?

"A"

'A'

65

'A' and 65

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the smallest primitive data type in Java?

int
float
byte
double

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid identifier in Java?

myVariable
var_1
3rdVariable
_tempVar

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In Java, which datatype is used to store True/False values?

int
char
boolean
float

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct way to declare an hexa decimal value in Java?

int num = 0x1a;
int num = 1a;
int num = #1a;
int num = &1a;

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to declare a boolean variable named isJavaFun and initialize it to true in Java?

boolean isJavaFun = true;
boolean isJavaFun == true;
isJavaFun = boolean.true;
boolean isJavaFun = 'true';

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