All Free Software Engineering MCQs with Answers

Every Software Engineering question in the bank, across all chapters, each with the correct answer and a written explanation. Free and unlimited, with no account needed.

1,731 questions · page 13 of 87

  • A. Prints 2.5
  • B. Raises an exception
  • C. Raises an error as STATIC is used as a variable which is a keyword
  • D. None of these

Explanation: STATIC is a legal identifier because Java keywords are lowercase and STATIC is not a keyword.

Correct answer: Prints 2.5
  • A. Object
  • B. Variable
  • C. Class
  • D. Method

Explanation: String is a predefined Java class used to represent sequences of characters.

Correct answer: Class
  • A. 0
  • B. 1
  • C. 2
  • D. 3

Explanation: A running Java application has at least one thread, normally the main thread that begins execution of main().

Correct answer: 1
  • A. yield() method
  • B. Suspend() method
  • C. start() method
  • D. resume() method

Explanation: The deprecated suspend operation pauses a thread, and resume() releases that suspended state.

Correct answer: resume() method
  • A. signed
  • B. unsigned
  • C. Both of the above
  • D. None of these

Explanation: Java's byte, short, int, and long primitive integer types all use signed two's-complement representation.

Correct answer: signed
  • A. println
  • B. final
  • C. super
  • D. static

Explanation: A method declared with the `final` modifier cannot be overridden in a subclass.

Correct answer: final
  • A. java.io package
  • B. java.lang package
  • C. java.awt package
  • D. java.util package

Explanation: `gc()` is associated with `System.gc()`, and the `System` class belongs to the `java.lang` package, which Java imports automatically.

Correct answer: java.lang package
  • A. A Boolean literal
  • B. A Java keyword
  • C. Same as value 0
  • D. Same as value 1

Explanation: `true` is a Boolean literal in Java, alongside `false`; it is not a keyword and Java does not treat it as numeric 0 or 1.

Correct answer: A Boolean literal
  • A. Declare the method with the keyword public.
  • B. Declare the method with the keyword private.
  • C. Do not declare the method with any accessibility modifiers.
  • D. Declare the method with the keyword public and private.

Explanation: A method with no access modifier has package-private access, so it can be used by classes in the same package but not by classes in other…

Correct answer: Do not declare the method with any accessibility modifiers.
  • A. java dissasamebler
  • B. java header file
  • C. java interpreter
  • D. java compiler

Explanation: `javah` was the Java tool used to generate native-method header files, hence the intended expansion is Java header file.

Correct answer: java header file
  • A. java
  • B. javac
  • C. javap
  • D. none of these

Explanation: `javac` is the Java compiler command: it translates `.java` source files into bytecode `.class` files.

Correct answer: javac
  • A. 8 bit
  • B. 16 bit
  • C. 32 bit
  • D. 64 bit

Explanation: Java defines an int as a signed 32-bit primitive regardless of the machine or JVM implementation. Its range is -2^31 to 2^31 - 1.

Correct answer: 32 bit
  • A. 7 8
  • B. 8 7
  • C. 9 8
  • D. None

Explanation: A leading zero makes an integer literal octal in Java, so 010 equals decimal 8 and 07 equals decimal 7.

Correct answer: 8 7
  • A. From within protected methods you do not have access to public methods.
  • B. This method is only accessible from inside the class itself and from inside all subclasses.
  • C. In a class, you cannot declare methods with a lower visibility than the visibility of the class in which it is defined.
  • D. This method is accessible from within the class itself and from within all classes defined in the same package as the class itself.

Explanation: A protected method is accessible within its own class and by classes in the same package, as stated in option d.

Correct answer: This method is accessible from within the class itself and from within all classes defined in the same package as the class itself.

255. JIT meaning ?

  • A. just in time
  • B. java in time
  • C. join in time
  • D. none of above

Explanation: JIT stands for Just-In-Time compilation, in which frequently executed bytecode is compiled into native machine code during program…

Correct answer: just in time
  • A. Interface
  • B. Class
  • C. Variable
  • D. Method

Explanation: Runnable is a Java interface containing the run() method. A class implements it to define work that can be executed by a thread.

Correct answer: Interface
  • A. At Compile-time
  • B. At run-time
  • C. Depends on the code
  • D. None of these

Explanation: The new keyword creates an object and allocates its memory while the program is running, so object creation occurs at run time rather than…

Correct answer: At run-time
  • A. reclaim() method
  • B. finalize() method
  • C. final() method
  • D. both b and c

Explanation: Historically, the JVM could call finalize() on an unreachable object before garbage collection reclaimed it.

Correct answer: finalize() method
  • A. .class
  • B. .doc
  • C. .java
  • D. .cdr

Explanation: The Java compiler converts source code into bytecode stored in a .class file, which the JVM later loads and executes.

Correct answer: .class
  • A. abstract
  • B. static
  • C. volatile
  • D. final

Explanation: The static keyword makes a variable belong to the class itself, so one shared copy exists rather than a separate copy for every object.

Correct answer: static