placeholder image to represent content

Introduction to Java: Quiz 2

Quiz by Kushal Verma

Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

New Quizalize solo game modes
15 questions
Show answers
  • Q1
    Which of these classes are the direct subclasses of the Throwable class?
    Error and Exception class
    IOException and VirtualMachineError class
    Exception and VirtualMachineError class
    RuntimeException and Error class
    45s
  • Q2
    Which of these keywords must be used to handle the exception thrown by try block in some rational manner?
    throws
    catch
    throw
    finally
    30s
  • Q3
    File class is included in which package?
    java.lang
    java.net
    java.io
    java.util
    45s
  • Q4
    Given the code: String s1 = ”yes” ; String s2 = ”yes” ; String s3 = new String (s1); Which of the following would equate to true?
    s1 == s3
    Compilation Error
    s1 == s3
    s1 == s2
    45s
  • Q5
    What type of Exceptions can NOT be ignored at compile time?
    Error
    Checked Exceptions
    Uncompiled Exceptions
    Unchecked Exceptions
    45s
  • Q6
    java.lang.NullPointerException is a
    Runtime Exception
    None of the given
    Compile time Exception
    Error
    45s
  • Q7
    Which of these will be invalid declaration?
    try-finally block
    try-catch-finally block
    catch-finally block
    try-catch block
    45s
  • Q8
    Which of the statement is not true about String in java?
    String is case sensitive in Java.
    String class is defined in java.util package.
    String is thread-safe in Java.
    String is immutable in Java.
    45s
  • Q9
    Which of these class is used to read bytes from a file?
    FileInputStream
    OutputReader
    FileWriter
    FileReader
    45s
  • Q10
    Which of these class is used to write characters in a file?
    FileOutput
    FileOutputStream
    StreamWriter
    FileWriter
    45s
  • Q11
    Which of these methods are used to read in from file?
    read()
    scan()
    get()
    readFileInput()
    45s
  • Q12
    Which of these exception is thrown in cases when the file specified for reading is not found?
    FileInputException
    FileNotFoundException
    FileException
    NullPointerException
    45s
  • Q13
    Which are the special symbols used to declare an array in Java?
    []
    <>
    {}
    ()
    45s
  • Q14
    What is the output of the below Java program? int[] marks = {35,65,95}; System.out.print(marks.length + "," + marks[1]);
    2,65
    3,65
    2,35
    3,35
    45s
  • Q15
    What is the output of the below Java code snippet? int[] buckets = {}; System.out.print(buckets.length);
    Compiler error
    0
    1
    -1
    45s

Teachers give this quiz to your class