Basic Syntax


  1. Which of the below is invalid identifier with main method?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    main method cannot be private as it is invoked by external method. Other identifier are valid with main method.


  1. Which statement is true about java?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Java is called ‘Platform Independent Language’ as it primarily works on the principle of ‘compile once, run everywhere’.



  1. Which component is responsible to optimize bytecode to machine code?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    JIT optimizes bytecode to machine specific language code by compiling similar bytecodes at same time.This reduces overall time taken for compilation of bytecode to machine specific language.


  1. Which component is responsible to run java program?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    JRE is the implementation of JVM, it provides platform to execute java programs.



  1. Which component is responsible for converting bytecode into machine specific code?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    JVM is responsible to converting bytecode to the machine specific code. JVM is also platform dependent and provides core java functions like garbage collection,memory management, security etc.