Java Programming (3350703) MCQs

MCQs of Building Blocks of the Language

Showing 1 to 10 out of 51 Questions
1.

How many primitive datatypes available in java?

(Java મા કેટલી પ્રીમીટીવ ડેટાટાઈપ આવેલ છે?)

(a)

6

(b)

7

(c)

8

(d)

9

Answer:

Option (c)

2.

Which of the following is not a primitive data type ?

(નીચે આપેલમાંથી કયો વિકલ્પ પ્રીમીટીવ ડેટાટાઈપ નથી?)

(a)

short

(b)

int

(c)

byte

(d)

enum

Answer:

Option (d)

3.

In java int, byte, short and long all of these are_______datatype.

(Java મા int, byte, short અને long એ _________ ડેટાટાઈપ છે.)

(a)

unsigned

(b)

signed

(c)

can't say

(કઈ કહી ન શકાય)

(d)

None of given

(આપલેમાંથી એકપણ નહિ)

Answer:

Option (b)

4.

The smallest integer type is _____ and size of it is _______ bits.

(નાના મા નાની ઈન્ટીજર ડેટાટાઈપ _________ છે અને તેની સાઈઝ _________ bits છે.)

(a)

byte, 8

(b)

short, 8

(c)

short, 16

(d)

int, 16

Answer:

Option (a)

5.

Which of the coding type is used for datatype character in Java?

(Java મા character ડેટાટાઈપ માટે કઈ કોડીંગ ટાઈપ નો ઉપયોગ થાય છે?)

(a)

UNICODE

(b)

ASCII

(c)

ISO-LATIN-1

(d)

ISO-LATIN-2

Answer:

Option (a)

6.

What will be the output of following code?

(નીચે આપેલ કોડ નું આઉટપુટ શું આવશે?)

(a)

abc

(b)

aaa

(c)

ab

(d)

abb

Answer:

Option (a)

7.

Which of the following is not valid identifier?

(નીચે આપેલમાંથી કયો વિકલ્પ વેલીડ આઇડેન્ટિફાયર નથી?)

(a)

A1

(b)

$hello

(c)

First_Name

(d)

First-Name

Answer:

Option (d)

8.

Default value for boolean datatype variable is __________.

(boolean ડેટાટાઈપ વેરીએબલ માટે ડીફોલ્ટ વેલ્યુ ________ છે.)

(a)

true

(b)

false

(c)

null

(d)

garbage (ગાર્બેજ)

Answer:

Option (b)

9.

Automatic type conversion takes place in java when,

(Javaમા ઓટોમેટીક ટાઈપ કન્વર્ઝન થાય છે જયારે,)

(a)

Two types are compatible and size of destination type is larger than source type

(બંને ડેટાટાઈપ કમ્પેટિબલ હોય અને ડેસ્ટીનેશન ડેટાટાઈપ એ સોર્સ ડેટાટાઈપ કરતા મોટી હોય)

(b)

Two types are compatible and size of destination type is smaller than source type

(બંને ડેટાટાઈપ કમ્પેટિબલ હોય અને ડેસ્ટીનેશન ડેટાટાઈપ એ સોર્સ ડેટાટાઈપ કરતા નાની હોય)

(c)

Two types are not compatible

(બંને ડેટાટાઈપ કમ્પેટિબલ ન હોય)

(d)

None of given

(આપલેમાંથી એકપણ નહિ)

Answer:

Option (a)

10.

What will be the output of following code?

(નીચે આપેલ કોડ નું આઉટપુટ શું આવશે?)

(a)

50

(b)

100

(c)

200

(d)

compilation error

(કમ્પાઈલેશન એરર)

Answer:

Option (d)

Showing 1 to 10 out of 51 Questions