Tag: programming languages

Questions Related to programming languages

For concatenation of strings, which method is good, StringBuffer or String

  1. String

  2. StringBuffer

  3. Both

  4. None


Correct Option: B

For concatenation of strings, which method is good, StringBuffer or String

  1. String Buffer

  2. String

  3. both

  4. none


Correct Option: A

The following are used for Thread communication

  1. wait,notify,notifyall

  2. wait,notify,notifyall,sleep

  3. Yield,sleep

  4. yield, sleep, wait


Correct Option: A

Java provide ______ construct to find out the size of an object

  1. sizeOf ()

  2. size()

  3. getSize()

  4. No such method in java to find size of an object directly.


Correct Option: D

modifiers that allowed for methods in an Interface

  1. public, abstract

  2. abstract, final

  3. final

  4. public


Correct Option: A

What is "delete" in java?

  1. a Keyword

  2. a method

  3. a special identifier

  4. none


Correct Option: D

Differences between Value types and Reference types

  1. Value type variables are stored on stack. Reference type variables are stored on heap.

  2. Value type holds the data directly, Reference type points to the location that holds the data.

  3. Value type cannot contain null value. Reference type can contain null value.

  4. A new type cannot be derived from value type. A new type can be derived from reference type.

  5. All of the above


Correct Option: E

Which of the following is value type

  1. string

  2. class

  3. delegate

  4. struct

  5. interface


Correct Option: D
  1. An indexer is always an instance member, but a property can be static also.

  2. A property is always an instance member, but An indexer can be static also.

  3. Indexers can not be participate in inheritance, properties can also participate in inheritance

  4. No difference


Correct Option: A