Java Programming (3350703) MCQs

MCQs of Building Blocks of the Language

Showing 31 to 40 out of 51 Questions
31.

Range of byte datatype is ____________.

(byte ડેટાટાઈપ ની રેન્જ ___________ છે.)

(a)

-127 to 128

(b)

-128 to 127

(c)

-127 to 127

(d)

-128 to 128

Answer:

Option (b)

32.

In java size of int datatype  is _______ bits.

(Java મા int ડેટાટાઈપની સાઈઝ _________ bits છે.)

(a)

16

(b)

32

(c)

64

(d)

48

Answer:

Option (b)

33.

In java size of float datatype is _______ bits.

(Java મા float ડેટાટાઈપની સાઈઝ _________ bits છે.)

(a)

16

(b)

32

(c)

64

(d)

128

Answer:

Option (b)

34.

Size of double datatype in java is ________ bits.

(Java મા double ડેટાટાઈપની સાઈઝ _________ bits છે.)

(a)

16

(b)

32

(c)

64

(d)

128

Answer:

Option (c)

35.

Which of following value cannot be store in character datatype?

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

(a)

digit

(ડીઝીટ)

(b)

letter

(લેટર)

(c)

special character

(સ્પેશિયલ કેરેક્ટર)

(d)

string

(સ્ટ્રીંગ)

Answer:

Option (d)

36.

Which of the following is a valid long literal?

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

(a)

L995623

(b)

0xnf029L

(c)

958923

(d)

ACH8997

Answer:

Option (b)

37.

Which of the following is valid for automatic type conversion?

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

(a)

int to byte

(int થી byte)

(b)

int to short

(int થી short)

(c)

int to long

(int થી long)

(d)

long to int

(long થી int)

Answer:

Option (c)

38.

What will be the output of following code? 

class demo
{
   static boolean a;
   public static void main(String ar[])
   {
      System.out.println(a);
   }
}

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

class demo
{
   static boolean a;
   public static void main(String ar[])
   {
      System.out.println(a);
   }
}
(a)

false

(b)

true

(c)

compilation error because a is not initialized.

કમ્પાઈલેશન એરર આવશે કારણકે a ઇનીસીએલાઈઝ થયેલ નથી.

(d)

compilation error because boolean variable can never be declare as static.

કમ્પાઈલેશન એરર આવશે કારણકે બુલિયન વેરીઅબલ ને સ્ટેટિક ક્યારેય ડીકલેર ન કરી શકાય.

Answer:

Option (a)

39.

Which of the following are valid statement in java?

1) long  a =  (byte)100;

2) int  b =  (int)888.8;

3) byte  c =  (byte)100L;

4) byte  d =  (byte)1000L;

નીચે આપેલ વિકલ્પ માંથી કયું/ક્યા સ્ટેટમેન્ટ વેલીડ છે?

1) long  a =  (byte)100;

2) int  b =  (int)888.8;

3) byte  c =  (byte)100L;

4) byte  d =  (byte)1000L;

(a)

1 & 2

(1 અને 2)

(b)

2 & 3

(2 અને 3)

(c)

2, 3 & 4

(2, 3 અને 4)

(d)

1, 2, 3 &  4

(1, 2, 3 અને 4)

Answer:

Option (d)

40.

Which of following class is superclass of String and StringBuffer class?

(નીચે આપેલ વિકલ્પ માંથી કયો class String અને StringBuffer class નો superclass(સુપરક્લાસ) છે?)

(a)

java.util

(b)

java.io

(c)

java.lang

(d)

java.sql

Answer:

Option (c)

Showing 31 to 40 out of 51 Questions