How To Hire Java Developers?

13 Questions | Total Attempts: 46

SettingsSettingsSettings
Please wait...
Java Quizzes & Trivia

Would you like to know everything in java developers? Take this quiz and test yourself now. All the best!


Questions and Answers
  • 1. 
    A method name min() that needs two integer arguments is declared as
    • A. 

      Public void min();

    • B. 

      Public void min (int a, b);

    • C. 

      Public void min (int a, int b);

    • D. 

      Public int min (a, b);

    • E. 

      SKIP THE QUESTION

  • 2. 
    You store java source code files with following extension?
    • A. 

      .java

    • B. 

      .class

    • C. 

      .src

    • D. 

      .javadoc

    • E. 

      SKIP THE QUESTION

  • 3. 
    Java language has support for which following types of comments
    • A. 

      Block, line and javadoc

    • B. 

      Javadoc, literal and string

    • C. 

      Javadoc, char and string

    • D. 

      Single, multiple and quote

    • E. 

      SKIP THE QUESTION

  • 4. 
    In Java language, the argument to the method is within 
    • A. 

      Curly braces

    • B. 

      Parenthesis

    • C. 

      Square brackets

    • D. 

      Single quote

    • E. 

      SKIP THE QUESTION

  • 5. 
    State which of the following statements are true (1) A series of characters that appear in double quote is a Char literal(2) Java language is case sensitive(3) The Java programming language is both compiled and interpreted.(4) As long as a computer has a Java Virtual Machine, the same program written in the Java programming language can run on any computer
    • A. 

      All four

    • B. 

      2,3 and 4

    • C. 

      2 and 4

    • D. 

      2 and 3

    • E. 

      SKIP THE QUESTION

  • 6. 
    What will be the result of compiling following code  public class MyClass  {  public static void main(String args[])  {    System.out.println("In first main()");  }  public static void  main(char args[])   {    System.out.println('a');  } }
    • A. 

      (1) Code will not compile and will give "Duplicate main() method declaration" error

    • B. 

      (2) Code will compile correctly but will give a runtime exception

    • C. 

      (3) Code will compile correctly and will print "In first main()" (without quotes) when run with argument of 'a'.

    • D. 

      (4) Code will compile correctly and will print "a" (without quotes) when run with argument of 'a'.

    • E. 

      SKIP THE QUESTION

  • 7. 
    Which are the valid declarations for an integer literal (1) 0(2) -5(3) 0416(4) 0xabcdef
    • A. 

      All 4

    • B. 

      1 and 2

    • C. 

      1,2 and 3

    • D. 

      SKIP THE QUESTION

  • 8. 
    A subclass is also called as
    • A. 

      Inner class

    • B. 

      Nested class

    • C. 

      Derived class

    • D. 

      Hidden class

    • E. 

      SKIP THE QUESTION

  • 9. 
    State which of the following statements are True (1) Java language support multi-dimentional arrays (2) StringBuffer  class is alternative to String class (3) A class which you create only to extend from, but not to instantiatefrom is called derived class(4) You cannot instantiate objects of interfaces or abstract classes
    • A. 

      All 4

    • B. 

      1 and 2

    • C. 

      1,2 and 4

    • D. 

      SKIP THE QUESTION

  • 10. 
    State which of the following statements are True (1) Each method in a parent class can be overridden at most once in any one subclass(2) A method can be overloaded in the class it is defined as well as in the subclass of its class(3) Overriding methods must return exactly the same type as the method they override(4) An overriding method must not be less accessible than the method itoverrides
    • A. 

      All 4

    • B. 

      1 and 2

    • C. 

      1,2 and 4

    • D. 

      SKIP THE QUESTION

  • 11. 
    What will be the outcome of executing following code. class MyClass{ public static void main(String []args) {   final int i = 100;   byte b = i;   System.out.println(b); }}
    • A. 

      Will give compilation error

    • B. 

      Will compile and print 100

    • C. 

      Will throw an exception

    • D. 

      SKIP THE QUESTION

  • 12. 
    What will be the outcome of executing following code. class MyClass{  public static void main(String []args)  {   int i = 100;   byte b = i;   System.out.println(b);  }}
    • A. 

      Will give compilation error

    • B. 

      Will compile and print 100

    • C. 

      Will throw an exception

    • D. 

      SKIP THE QUESTION

  • 13. 
    What will be the outcome of executing following code.class MyClass{  public static void main (String args[])  {          String s1[] = new String[5];   String str = s1[0].toUpperCase();   System.out.println(str);    }}
    • A. 

      Will print null

    • B. 

      Will give NullPointerException

    • C. 

      Will not compile

    • D. 

      Will print NULL

    • E. 

      SKIP THE QUESTION

Back to Top Back to top