0

programming languages Online Quiz - 55

Description: programming languages Online Quiz - 55
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

How can pointers be used in C#

  1. No,pointers can not be used here

  2. by using unsafe block

  3. by compiling using /unsafe option in command line only

  4. Both B and C

  5. None


Correct Option: D

Which of the Statements is true

  1. Static Variables are Set at RunTime

  2. Sealed classes cannot be Overriden

  3. finally' block executes only when exception occurs

  4. Both A and B

  5. Both B and C


Correct Option: D

What does 'new' keyword do when used as a modifier for a method (inheritance)?

  1. Adds a Reference to the parents class method

  2. it only hides the parent class method

  3. it overrides the parent class method

  4. None

  5. All the Above


Correct Option: B
  1. extraction operator

  2. scope resolution operator

  3. insertion operator

  4. All the above


Correct Option: B

Which of the following exists in C++ ?

  1. virtual constructor

  2. virtual destructor

  3. both A and B

  4. None of the above


Correct Option: B
  1. Simple constructor

  2. parameterized constructor

  3. copy constructor

  4. none of the above


Correct Option: C
  1. call by reference

  2. call by value

  3. call by address

  4. All the above


Correct Option: A

What will be the value of variable 'z' after execution of following code? int z; for(z=0;z<50;z++) {}

  1. 0

  2. 51

  3. 49

  4. 50


Correct Option: D

class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Sprite{ 14. // insert code here 15. } Which code, inserted at line 14, allows the Sprite class to compile?

  1. Direction d = NORTH;

  2. Nav.Direction d = NORTH;

  3. Direction d = Direction.NORTH;

  4. Nav.Direction d = Nav.Direction.NORTH;


Correct Option: D

Which Man class properly represents the relationship "Man has a best friend who is a Dog"?

  1. class Man extends Dog { }

  2. class Man implements Dog { }

  3. class Man { private BestFriend dog; }

  4. class Man { private Dog bestFriend; }

  5. class Man { private Dog; }


Correct Option: D

Given: 1. package test; 2. 3. class Target { 4. public String name = "hello"; 5. } What can directly access and change the value of the variable name?

  1. any class

  2. only the Target class

  3. any class in the test package

  4. any class that extends Target


Correct Option: C

A team of programmers is reviewing a proposed API for a new utility class. After some discussion, they realize that they can reduce the number of methods in the API without losing any functionality. If they implement the new design, which two OO principles will they be promoting?

  1. Looser coupling

  2. Tighter coupling

  3. Lower cohesion

  4. Higher cohesion


Correct Option: A
  1. It is possible for more than two threads to deadlock at once.

  2. The JVM implementation guarantees that multiple threads cannot enter into a

  3. Deadlocked threads release once their sleep() method's sleep duration has expired.

  4. Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are

  5. It is possible for a single-threaded application to deadlock if synchronized blocks are

  6. . If a piece of code is capable of deadlocking, you cannot eliminate the possibility of


Correct Option: A,F
  1. public int blipvert(int x) { return 0; }

  2. private int blipvert(int x) { return 0; }

  3. private int blipvert(long x) { return 0; }

  4. protected long blipvert(int x) { return 0; }

  5. protected int blipvert(long x) { return 0; }

  6. protected long blipvert(long x) { return 0; }


Correct Option: A,C,E,F
- Hide questions