Q.1

Which of the following modifiers can be used with Local inner class?

  • Final or Abstract
  • Final or Transcient
  • Abstract or Transcient
  • Final or public
Q.2

Which kind of inheritance is not supported directly through classes in java?

  • Multilevel
  • Multiple
  • Single
  • Hirarcheal
Q.3

Which is a reserved word in the java programming language?

  • Variable
  • Identifier
  • Keyword
  • Main
Q.4

Which king class properly represents the relationship "King has a best friend who is a Soldier"?

  • class King extends Soldier { }
  • class King implements Soldier { }
  • class King { private BestFriend Soldier; }
  • class King { private Soldier bestFriend; }
Q.5

An algorithm written once which can be used in many places is called

  • Block
  • Function
  • Datatype
  • None
Q.6

Which key word is to be used to tell the JVM to skip the variable while performing the serialization process of the object containing it?

  • Transcient
  • Volatile
  • Static
  • Final
Q.7

The keyword which indicates that a method can be accessed by only one thread at a time is

  • Strictfp
  • Synchronized
  • New
  • None
Q.8

Which of the following is not used for commenting in java?

  • //
  • /* */
  • /** */
  • /** **/
Q.9

public abstract class Shape {

private int x;

private int y;

public abstract void draw();

public void setAnchor(int x, int y) {

this.x = x;

this.y = y;

}

}

Which two classes use the Shape class correctly?

  • public class Circle implements Shape { private int radius;
  • public abstract class Circle extends Shape { private int radius; }
  • public class Circle extends Shape { private int radius; public void draw();
  • None
Q.10

Which of the following attribute can hold the JavaScript version?

  • script
  • version
  • language
  • none of the above
Q.11

A lock can be acquired on a class.

The above statement is

  • True
  • False
  • Both A and B
  • None
Q.12

How many constructors can a class have?

  • 1
  • 2
  • 4
  • None of the above
Q.13

Which method names follow the JavaBeans standard?

  • addSize
  • putDimensions
  • getCust
  • deleteRep
Q.14

Which of the following statements about inheritance is false?

  • Inheritance allows you to minimize the amount of duplicate code in an application by sharing common code among several subclasses.
  • A subclass inherits all the members (fields, methods, and nested classes) from its superclass.
  • Through inheritance, a parent class is a more specialized form of the child class.
  • Inheritance allows you to reuse the fields and methods of the super class without having to write them yourself.
Q.15

Exception handling is targeted at

  • Compile time error
  • Logical error
  • Run time error
  • All of the above
Q.16

Which is true?

  • "X extends Y" is correct if and only if X is a class and Y is an interface
  • "X extends Y" is correct if and only if X is a class and Y is an interface
  • "X extends Y" is correct if X and Y are either both classes or both interfaces
  • "X extends Y" is correct for all combinations of X and Y being classes and/or interfaces
Q.17

Which of the following are incorrect form of StringBuffer class constructor  ?

  • StringBuffer(int size , String str)
  • StringBuffer(int size)
  • StringBuffer(String str)
  • StringBuffer()
Q.18

void waitForSignal() {

Object obj = new Object();

synchronized (Thread.currentThread()) {

obj.wait();

obj.notify();

}

}

Which statement is true?

  • This code can throw an InterruptedException.
  • This code can throw an IllegalMonitorStateException.
  • This code can throw a TimeoutException after ten minutes
  • All the above
Q.19

main() {

int i;

printf("%d",scanf("%d",&i)); // value 10 is given as input here

}

  • 1
  • 2
  • 3
  • 4
Q.20

Which of the following are capabilities of functions in JavaScript?

  • Accept parameters
  • Return a value
  • Accept parameters and Return a value
  • None of the above
0 h : 0 m : 1 s