Code Execution Championship -round-1- Java

41 Questions | Total Attempts: 478

SettingsSettingsSettings
Java Quizzes & Trivia

Pls Note:1) There are 20 questions in a quiz. 2) Time duration is 15 minutes. 3) Only one attempt is allowed. 4) Candidate can navigate questions and review answers before final submission5) Compulsory to fill all the mentioned details. 6) Kindly provide the correct details.


Questions and Answers
  • 1. 
    From the following statements which is a disadvantage of an java array?
    • A. 

      An array can hold primitive types data

    • B. 

      . An array has its size that is known as array length

    • C. 

      An array knows only its type that it contains. Array type is checked at the compile-time

    • D. 

      An array holds only one type of data

  • 2. 
    Which method returns the interrupted flag after that it sets the flag to false if it is true?
    • A. 

      IsInterrupted()

    • B. 

      Static interrupted()

    • C. 

      Non static interrupted()

    • D. 

      Both A & C

  • 3. 
    Abbreviate the term POJO?
    • A. 

      Plain Old Java Object

    • B. 

      Performance Old Java Object

    • C. 

      Performance Optimize Java Object

    • D. 

      None of the above

  • 4. 
    The following two rules are defined by? 1. The parameters may differ in their type or number, or in both. 2. They may have the same or different return types.
    • A. 

      Method overloading

    • B. 

      Method overriding

    • C. 

      Constructor overloading

    • D. 

      None of the above

  • 5. 
    Which allows you to migrate your implementations over time without breaking the code that depends on the public interface of your classes?
    • A. 

      Polymorphism

    • B. 

      Inheritance

    • C. 

      Encapsulation

    • D. 

      Both A & B

  • 6. 
    Which is used for writing data to a file in file handling?
    • A. 

      FileInputStream

    • B. 

      FileOutputStream

    • C. 

      Both A & B

    • D. 

      None of the above

  • 7. 
    In which state is the thread after invocation of start() method, but the thread Scheduler has not selected it to be the running thread?
    • A. 

      Running

    • B. 

      Runnable

    • C. 

      Terminated

    • D. 

      Non-Runnable

  • 8. 
    Which package is used for analyzing code during run time?
    • A. 

      java.lang.reflect

    • B. 

      Java.awt

    • C. 

      Java.io

    • D. 

      Java.applet

  • 9. 
    Which mechanism is provided to handle the runtime errors so that normal flow of the application can be maintained?
    • A. 

      Exception Handling

    • B. 

      String Handling

    • C. 

      Event Handling

    • D. 

      None of the above

  • 10. 
    Which driver uses ODBC driver to connect to the database?
    • A. 

      JDBC-ODBC bridge driver

    • B. 

      Native - API driver

    • C. 

      Network Protocol driver

    • D. 

      Thin driver

  • 11. 
    Which is invoked after the init() method or browser is maximized?
    • A. 

      Public void start()

    • B. 

      Public void paint(Graphics g)

    • C. 

      Public void stop()

    • D. 

      Public void init()

  • 12. 
    Which class provides many methods for graphics programming?
    • A. 

      Java.awt

    • B. 

      java.Graphics

    • C. 

      Java.awt.Graphics

    • D. 

      None of the above

  • 13. 
    Which statement provides an easy way to dispatch execution to different parts of your code based on the value of an expression?
    • A. 

      If

    • B. 

      Switch

    • C. 

      Nested-if

    • D. 

      If-else-if

  • 14. 
    Which field of StreamTokenizer if the token is a word, this filed contains the word that can be used in programming?
    • A. 

      String sval

    • B. 

      Double nval

    • C. 

      Int ttype

    • D. 

      Static final int TT_WORD

  • 15. 
    Which method of string class in java is used to convert the boolean into String?
    • A. 

      Public static String valueOf(double I)

    • B. 

      Public static String valueOf(boolean I)

    • C. 

      public boolean equals(Object anObject)

    • D. 

      Public static String valueOf(Object obj)

  • 16. 
    Which Exception occurs when a class is not found while dynamically loading a class using the class loaders?
    • A. 

      ClassNotFoundException

    • B. 

      ClassFoundException

    • C. 

      NoClassDefFoundError

    • D. 

      ClassDefFoundError

  • 17. 
    Which driver Network connection is indirect that a JDBC client makes to a middleware process that acts as a bridge to the DBMS server?
    • A. 

      JDBC-Net

    • B. 

      JDBC-ODBC bridge

    • C. 

      Native API as basis

    • D. 

      Native protocol as basis

  • 18. 
    Which Indicates a result set that cannot be updated programmatically in concurrency?
    • A. 

      CONCUR_UPDATABLE

    • B. 

      CONCUR_READ_ONLY

    • C. 

      All of the above

    • D. 

      None of the above

  • 19. 
    Which of the following is true about inheritance in Java? I) Private methods are final. II) Protected members are accessible within a package and inherited classes outside the package. III) Protected methods are final. IV) We cannot override private methods.
    • A. 

      1, 2 and 4

    • B. 

      1 and 2

    • C. 

      1, 2 and 3

    • D. 

      2, 3 and 4

  • 20. 
    What is the range of data type byte in Java?
    • A. 

      -128 to 127

    • B. 

      -32768 to 32767

    • C. 

      -2147483648 to 2147483647

    • D. 

      None of the mentioned

  • 21. 
    Which data type value is returned by all transcendental math functions?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Double

    • D. 

      Long

  • 22. 
    Which of the following can be operands of arithmetic operators?
    • A. 

      Numeric

    • B. 

      Boolean

    • C. 

      Characters

    • D. 

      Both Boolean & Characters

  • 23. 
    Modulus operator, %, can be applied to which of these?
    • A. 

      Integers

    • B. 

      Floating – point numbers

    • C. 

      Both Integers and floating – point numbers.

    • D. 

      None of the mentioned

  • 24. 
    Decrement operator, –, decreases value of variable by what number?
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

  • 25. 
    Which of these methods can be used to output a string in an applet?
    • A. 

      Display()

    • B. 

      Print()

    • C. 

      DrawString()

    • D. 

      Transient()

Back to Top Back to top