• 1. 
    String s = "Java String Quiz"; System.out.println(s.charAt(s.toUpperCase().length()));

  • Convert “Z” to int 90 and prints “90”
  • Runtime Exception
  • Prints “z”
  • Prints “Z”
  • 2. 
    String in Java is a?

  • class
  • object
  • variable
  • character array
  • 3. 
    String s = "Java String Quiz";System.out.println(s.substring(5,3));

  • Prints “Str”
  • Runtime Exception
  • IndexOutOfBoundsException Runtime Exception
  • StringIndexOutOfBoundsException Compile-time error
  • 4. 
    Which of these keywords is used to refer to member of base class from a subclass?

  • upper
  • super
  • this
  • none
  • 5. 
    Which of these method of String class is used to obtain character at specified index?

  • char()
  • Charat()
  • charat()
  • charAt()
  • 6. 
    String s1 = new String("java");String s2 = new String("JAVA");System.out.println(s1 = s2);

  • JAVA
  • java
  • true
  • false
  • 7. 
    Which of these method of String class can be used to test to strings for equality?

  • isequal()
  • isequals()
  • equal()
  • equals()
  • 8. 
    String obj = "I LIKE JAVA";System.out.println(obj.length());

  • 9
  • 10
  • 11
  • 12
  • 9. 
    Package is a collection of __________ .

  • Objects
  • Classes and Interfaces
  • Data
  • Variables and Constants
  • 10. 
    Which of the following classes belongs to lang package in Java?

  • String, Math, Integer, Float
  • Date, Scanner, Vector
  • String, InputStreamReader, InputStreamWriter
  • Button, Menu, Scrollbar, Checkbox
  • 11. 
    Select TWO correct ways of including (importing) package in our program?

  • Option A & C
  • Option A & D
  • Option B & D
  • Option B & C
  • 12. 
    String s1 = "abc";String s2 = "def";System.out.println(s1.compareTo(s2));

  • 0
  • true
  • -3
  • false
  • 13. 
    Which of the following classes belongs to util package in Java?

  • String, Math, Integer, Float
  • Date, Scanner, Vector
  • String, InputStreamReader, InputStreamWriter
  • Button, Menu, Scrollbar, Checkbox
  • 14. 
    Which function is used to input float value in Java using Scanner class?

  • scanner_object . nextFloat( )
  • scanner_object . nextInt( )
  • scanner_object . nextfloat( )
  • scanner_object . NextFloat( )
  • 15. 
    Which function is used to input String value in Java using Scanner class?

  • scanner_object . nextLine( )
  • scanner_object . nextString( )
  • scanner_object . nextText( )
  • scanner_object . nextChar( )
  • 16. 
    Which function is used to input int value in Java using Scanner class?

  • scanner_object . nextInteger( )
  • scanner_object . nextInt( )
  • scanner_object . nextint( )
  • scanner_object . NextInt( )
  • 17. 
    String s = "Java"+1+2+"Quiz"+""+(3+4);System.out.println(s);

  • Java3Quiz7
  • Java12Quiz7
  • Java12Quiz34
  • Java3Quiz34
  • 18. 
    Java is Truly (Pure) _____________ Language?

  • OOP
  • POP
  • Object Based
  • All of the given
Report Question
warning
access_time
  Time