Tag: programming languages

Questions Related to programming languages

  1. int aMethod(int i) throws IOException{...}

  2. protected int aMethod(int i) throws FileNotFoundException{...}

  3. public int aMethod(int i) throws Exception{...}

  4. public int aMethod(byte i) throws IOException{...}

  5. protected int aMethod(int i) throws IOException,FileNotFoundException{...}


Correct Option: B,E
  1. A static method may override another static method.

  2. A static method cannot override a non-static method.

  3. A non-static method cannot override a static method.

  4. A non-static method may be overloaded by a static method.

  5. A synchronized method cannot be overridden.


Correct Option: B,C,D
  1. The above code will not compile, Vector v is not initialized.

  2. The above code will compile and throw a Runtime Exception

  3. The above code will compile and not throw any Exception during runtime. V is initialized to null

  4. None of the Above.


Correct Option: A
  1. Float.POSITIVE_INFINITY

  2. Double.POSITIVE_INFINITY

  3. runtime Exception

  4. None of the Above


Correct Option: B
  1. superclass

  2. subclass

  3. instance class

  4. None of the Above


Correct Option: B
  1. The code will compile and print "Welcome"

  2. The code will compile and print "Good Bye"

  3. The code will cause a compiler error

  4. None of the Above


Correct Option: B