Tag: programming languages

Questions Related to programming languages

  1. Structs cannot be inherited.

  2. Structs are passed by value, not by reference.

  3. Struct is stored on the stack, not the heap.

  4. structs can be inherited


Correct Option: A
  1. Classes that are both in the same assembly and derived from the declaring class.

  2. Only methods that are in the same class as the method in question.

  3. Classes within the same assembly, and classes derived from the declaring class.

  4. Classes in different assembly


Correct Option: C
  1. 8 bit

  2. 1 bit

  3. machine dependent

  4. none of these


Correct Option: C
  1. void run();

  2. protected void go();

  3. public abstract set();

  4. none of these


Correct Option: A
  1. interface declares constant and instance variables.

  2. The abstract modifier can be combined with the static modifier .

  3. native modifier can be applied only on method.

  4. synchronized modifier can be applied to method as well as class

  5. none of these


Correct Option: C
  1. class cons{ cons() { } public void cons(); public static void main (String[] aa){ cons b=new cons(); } }

  2. public class cons { ............... cons() { } public cons(int x,int y) { System.out.print(x +" "+ y); } public static void main (String[] aa){ cons b=new cons(); cons obj=new cons(4,2); }

  3. public class cons { public cons(int x) { System.out.print(x); } public static void main (String[] aa){ cons b=new cons(); } }

  4. class cons{ cons() { } public float foo () { double f = 32; return f; } public static void main (String[] aa){ cons b=new cons(); } }


Correct Option: B
  1. 8 bit

  2. 1 bit

  3. machine dependent

  4. none of these


Correct Option: C