Syit Core Java 2019

35 Questions | Total Attempts: 70

SettingsSettingsSettings
Syit Core Java 2019 - Quiz

.


Questions and Answers
  • 1. 
    JAVA was first called as?
    • A. 

      Banyan 

    • B. 

      Oak

    • C. 

      Mahagony

    • D. 

      Sal

  • 2. 
    Which component is responsible for converting bytecode into machine specific code?
    • A. 

      JVM

    • B. 

      JDK

    • C. 

      JIT

    • D. 

      JRE

  • 3. 
    Which statement is true about java?
    • A. 

      Platform independent programming language

    • B. 

      Platform dependent programming language

    • C. 

      Code dependent programming language

    • D. 

      Sequence dependent programming language

  • 4. 
    Which of the below is invalid identifier with the main method?
    • A. 

      Public

    • B. 

      Static

    • C. 

      Private

    • D. 

      Final

  • 5. 
    What is the extension of java code files?
    • A. 

      .class

    • B. 

      .java

    • C. 

       .txt

    • D. 

      .js

  • 6. 
    Java is Architecture Neutral.
    • A. 

      True

    • B. 

      False

  • 7. 
    Decrement operator, −−, decreases the value of variable by what number?  
    • A. 

      1

    • B. 

      2

    • C. 

      3

    • D. 

      4

  • 8. 
     Which of the following is not OOPS concept in Java?
    • A. 

      Inheritance

    • B. 

      Encapsulation

    • C. 

      Polymorphism

    • D. 

      Compilation

  • 9. 
    Which of the following is a method having same name as that of its class?
    • A. 

      Finalize

    • B. 

      Delete

    • C. 

      Class

    • D. 

      Constructor

  • 10. 
    What is the return type of Constructors?
    • A. 

      Int

    • B. 

      Float

    • C. 

      Void

    • D. 

      None of the mentioned

  • 11. 
    Which function is used to perform some action when the object is to be destroyed?
    • A. 

      Finalize()

    • B. 

      Delete()

    • C. 

      Main()

    • D. 

      None of the mentioned

  • 12. 
    What is the output of this program?
    1. class box
    2. {
    3. int width;
    4. int height;
    5. int length;
    6. int volume;
    7. box()
    8. {
    9. width = 5;
    10. height = 5;
    11. length = 6;
    12. }
    13. void volume()
    14. {
    15. volume = width*height*length;
    16. }
    17. }
    18. class constructor_output
    19. {
    20. public static void main(String args[])
    21. {
    22. box obj = new box();
    23. obj.volume();
    24. System.out.println(obj.volume);
    25. }
    26. }
    • A. 

      200

    • B. 

      100

    • C. 

      150

    • D. 

      250

  • 13. 
    Which operator is used by Java run time implementations to free the memory of an object when it is no longer needed?
    • A. 

      Delete

    • B. 

      Free

    • C. 

      New

    • D. 

      None of the mentioned

  • 14. 
    Which of these keywords is used to make a class?
    • A. 

      Class

    • B. 

      Struct

    • C. 

      Int

    • D. 

      None of the mentioned

  • 15. 
    Which of these operators is used to allocate memory for an object?
    • A. 

      Malloc

    • B. 

      Alloc

    • C. 

      New

    • D. 

      Give

  • 16. 
    What is the output of this program?
    1. class box
    2. {
    3. int width;
    4. int height;
    5. int length;
    6. }
    7. class mainclass
    8. {
    9. public static void main(String args[])
    10. {
    11. box obj = new box();
    12. obj.width = 10;
    13. obj.height = 2;
    14. obj.length = 10;
    15. int y = obj.width * obj.height * obj.length;
    16. System.out.print(y);
    17. }
    18. }
    • A. 

      12

    • B. 

      200

    • C. 

      300

    • D. 

      400

  • 17. 
    Which of these access specifiers must be used for main() method?
    • A. 

      Private

    • B. 

      Public

    • C. 

      Protected

    • D. 

      None of the mentioned

  • 18. 
    Which of these access specifier must be used for class so that it can be inherited by another subclass?
    • A. 

      Public

    • B. 

      Private

    • C. 

      Protected

    • D. 

      None of the mentioned

  • 19. 
    Which method can be defined only once in a program?
    • A. 

      Main method

    • B. 

      Finalize method

    • C. 

      Static method

    • D. 

      Private method

  • 20. 
    Using which of the following, multiple inheritance in Java can be implemented?
    • A. 

      Interfaces

    • B. 

      Multithreading

    • C. 

      Protected methods

    • D. 

      Private methods

  • 21. 
    What is not type of inheritance?
    • A. 

      Single inheritance

    • B. 

      Double inheritance

    • C. 

      Hierarchical inheritanc

    • D. 

      Multiple inheritance

  • 22. 
    Which of the following is used for implementing inheritance through an interface?
    • A. 

      Inherited

    • B. 

      Using

    • C. 

      Extends

    • D. 

      Implements

  • 23. 
    What would be the result if a class extends two interfaces and both have a method with same name and signature?
    • A. 

      Runtime error

    • B. 

      Compile time error

    • C. 

      Code runs successfully

    • D. 

      First called method is executed successfully

  • 24. 
    Which of these keywords are used to define an abstract class?
    • A. 

      Abst

    • B. 

      Abstract

    • C. 

      Abstrat

    • D. 

      Static class

  • 25. 
    Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
    • A. 

      Do-while

    • B. 

      While

    • C. 

      For

    • D. 

      None of the mentioned

Back to Top Back to top