Java Programming (3350703) MCQs

MCQs of Building Blocks of the Language

Showing 41 to 50 out of 51 Questions
41.

Which of following class is used to create an object whose character sequence is mutable?

(character સિકવન્સ ને મ્યુટેબલ બનાવવા માટે નીચે આપેલ વિકલ્પમાંથી ક્યા class નો ઓબ્જેક્ટ બનાવવામાં આવે છે?)

(a)

String()

(b)

StringBuffer()

(c)

Integer()

(d)

Character()

Answer:

Option (b)

42.

Which operator is used to concatenate two or more string objects?

(બે કરતા વધારે સ્ટ્રીંગ ઓબ્જેક્ટ ને કોન્કેટ કરવા માટે ક્યા ઓપરેટર નો ઉપયોગ થાય છે?)

(a)

.

(b)

&

(c)

+=

(d)

+

Answer:

Option (d)

43.

Which method of String class is used to find the length of string?

(String ક્લાસ ની કઈ મેથડ સ્ટ્રીંગ લેન્થ શોધવા માટે ઉપયોગ થાય છે?)

(a)

length()

(b)

lengthOf()

(c)

sizeOf()

(d)

None of given

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

Answer:

Option (a)

44.

What will be the output of following code? 

class demo
{
   public static void main(String ar[])
   {
      String s1 = new String(""Hello"");
      String s2= new String(""hello"");
      System.out.println(s1.compareTo(s2));
   }
}

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

class demo
{
   public static void main(String ar[])
   {
      String s1 = new String(""Hello"");
      String s2= new String(""hello"");
      System.out.println(s1.compareTo(s2));
   }
}
(a)

32

(b)

-32

(c)

1

(d)

-1

Answer:

Option (b)

45.

Default capacity of StringBuffer class is _______.

(StringBuffer ક્લાસ ની ડીફોલ્ટ કેપેસીટી _________ છે.)

(a)

16

(b)

17

(c)

15

(d)

18

Answer:

Option (a)

46.

What will be the output of Logical AND operation, if one the operand is false?

(લોજીકલ AND ઓપરેશનમા જો એક ઓપ્રંડ ખોટું હોય તો આઉટપુટ શું આવશે?)

(a)

TRUE

(b)

FALSE

Answer:

Option (b)

47.

Which of following is not Bitwise operator?

(નીચે આપેલમાંથી કયો ઓપરેટર Bitwise ઓપરેટર નથી?)

(a)

|

(b)

&

(c)

<<

(d)

&&

Answer:

Option (d)

48.

Which of following logical operator works with single operand?

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

(a)

Logical AND

(લોજીકલ AND ) 

(b)

Logical OR

(લોજીકલ OR)

(c)

Logical NOT

(લોજીકલ NOT)

(d)

Logical EX-OR

(લોજીકલ EX-OR)

Answer:

Option (c)

49.

Which of the following operators can operate on a boolean variable?

1) ==

2) &&

3) +=

4) ||

નીચે આપેલમાંથી ક્યા ઓપરેટરો boolean વેરિએબલ પર ઓપરેટ થાય છે?

1) ==

2) &&

3) +=

4) ||

(a)

1 and 2

(1 અને 2)

(b)

1, 2 and 3

(1, 2 અને 3)

(c)

1,2 and 4

(1,2 અને 4)

(d)

1,2,3 and 4

(1,2,3 અને 4)

Answer:

Option (c)

50.

State TRUE or FALSE: In a FOR loop, the Initialization-part, Condition-part and Increment/Decrement part can be empty.

(આપેલ વિધાન સાચું છે કે ખોટું: FOR લૂપમા, ઇનીસીએલાઈઝ પાર્ટ, કંડીશન પાર્ટ અને ઇન્ક્રીમેન્ટ/ડીક્રીમેન્ટ પાર્ટ એમ્ટી હોય શકે.)

(a)

TRUE

(b)

FALSE

Answer:

Option (a)

Showing 41 to 50 out of 51 Questions