Tag: programming languages

Questions Related to programming languages

  1. p is a pointer to a 10 element integer array

  2. p is a 10-element array of pointers to integer quantity

  3. p is a pointer to an integer quantity

  4. None of the above


Correct Option: B
  1. p is a pointer to pointer to integer

  2. p is a pointer to a function that accepts an argument which is a pointer to a character and returns an integer quantity

  3. p is a function that accepts an argument which is a pointer to a character and returns an integer quantity

  4. p is a function that accepts an argument which is a pointer to a character and returns a pointer to an integer quantity


Correct Option: C
  1. p is a pointer to a 10 element integer array

  2. p is a pointer to an integer quantity

  3. p is a 10-element array of pointers to an integer

  4. None of the above


Correct Option: A
  1. The class does not compile because the top level class cannot be protected.

  2. The program prints "abc"

  3. The program prints "abcabc"

  4. The program does not compile because statement "test = test + test" is illegal.


Correct Option: A

Which of the following are true. Select the three correct answers.

  1. A static method may be invoked before even a single instance of the class is constructed.

  2. A static method cannot access non-static methods of the class.

  3. Abstract modifier can appear before a class or a method but not before a variable.

  4. final modifier can appear before a class or a variable but not before a method.

  5. Synchronized modifier may appear before a method or a variable but not before a class.


Correct Option: A,B,C
  1. It is possible for a program to free memory at a given time.

  2. Garbage Collection feature of Java ensures that the program never runs out of memory.

  3. It is possible for a program to make an object available for Garbage Collection.

  4. The finalize method of an object is invoked before garbage collection is performed on the object.


Correct Option: C,D