Quiz 4 - Bce Repeaters

10 Questions | Attempts: 71
Share

SettingsSettingsSettings
Computer Science Quizzes & Trivia

Exception Handling, Interfaces, MultiThreading


Questions and Answers
  • 1. 
    Let’s say we want to read a file and display its contents on the screen. Let’s assume the file is located on a remote server and during the process of reading it, the connection goes down. In this case, we have an _______
    • A. 

      Compile time error

    • B. 

      Logical error

    • C. 

      Syntax error

    • D. 

      Exception

  • 2. 
    Exception handling is a mechanism, which allows exceptions to be ____ and _____
    • A. 

      Compile, caught

    • B. 

      Compile, try

    • C. 

      Try, thrown

    • D. 

      Thrown, caught

  • 3. 
    Try{    // Some code that may throw an exception}catch (ExceptionType objectName){    // Code handling an Exception}Within the try block we put the code that could throw exceptions.
    • A. 

      True

    • B. 

      False

  • 4. 
    Which of these can be used to fully abstract a class from its implementation?
    • A. 

      Objects

    • B. 

      Packages

    • C. 

      Interfaces

    • D. 

      None

  • 5. 
    Which of the following is correct way of implementing an interface salary by class manager?
    • A. 

      Class manager extends salary {}

    • B. 

      Class manager implements salary {}

    • C. 

      Class manager imports salary {}

    • D. 

      None of the mentioned.

  • 6. 
    Private access specifiers can be used for an interface
    • A. 

      True

    • B. 

      False

  • 7. 
    Which of these class is used to make a thread?
    • A. 

      String

    • B. 

      Thread

    • C. 

      System

    • D. 

      Runnable

  • 8. 
    Which of these interface is implemented by Thread class?
    • A. 

      Runnable

    • B. 

      Connections

    • C. 

      None

    • D. 

      Both a and B

  • 9. 
    Which of these method of Thread class is used to Suspend a thread for a period of time?
    • A. 

      Terminate()

    • B. 

      Suspend()

    • C. 

      Sleep()

    • D. 

      Stop()

  • 10. 
    Every thread including main thread starts execution from run() method.
    • A. 

      True

    • B. 

      False

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.