Online Test



Which of the following are Java reserved words?

  1. run
  2. import
  3. default
  4. implement

Which statement is true about a static nested class?

What is Truncation is Java?

What will be the output of the program?

class Test 
    public static void main(String [] args) 
        int x=20;
        String sup = (x < 15) ? "small" : (x < 22)? "tiny" : "huge";

Which of these is necessary condition for automatic type conversion in Java?

 What is the output of this program?

 class booloperators {
        public static void main(String args[]) 
            boolean var1 = true;
        boolean var2 = false;
        System.out.println((var2 & var2));

What is the range of data type short in Java?

What will this code print?
int arr[] = new int [5];

What allows the programmer to destroy an object x?

What is the output of this program?

class main_class {
        public static void main(String args[])
            int x = 9;
            if (x == 9) { 
                int x = 8;

You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability?

Which of the following package stores all the standard java classes?

Which two of the following methods are defined in class Thread?

  1. start()
  2. wait()
  3. notify()
  4. run()
  5. terminate()

Which three are valid method signatures in an interface?

  1. private int getArea();
  2. public float getVol(float x);
  3. public void main(String [] args);
  4. public static void main(String [] args);
  5. boolean setFlag(Boolean [] test);

Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?

How can we create an unsigned int variable in Java?

You want subclasses in any package to have access to members of a superclass. Which is the most restrictive access that accomplishes this objective?

A _________ is a basic unit of storage in Java.

What are the pillars of OOPS concept?

Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object?

Which three are methods of the Object class?

  1. notify();
  2. notifyAll();
  3. isInterrupted();
  4. synchronized();
  5. interrupt();
  6. wait(long msecs);
  7. sleep(long msecs);
  8. yield();

What will be the output of the program?

public class Foo 
    public static void main(String[] args) 
            System.out.println( "Finally" ); 

Which of the following is correct way of importing an entire package ‘pkg’?

Which constructs an anonymous inner class instance?

Which of these packages contains the exception Stackoverflow in Java?


About Us is an online learning website.We cover the latest tech news,online tutorials,blog,online test for Aptitude,C,Java,PHP to improve your knowledge.


Follow TechEpi on