QUESTIONS SPANNING CORE COMPUTER SCIENCE CONCEPTS, JAVA
SYNTAX AND SEMANTICS, IDE USAGE, COMPILATION
(SOURCE/BYTE/EXECUTABLE CODE), PRIMITIVE TYPES & IDENTIFIERS,
OPERATORS (INCREMENT/DECREMENT), CONSTANTS, ERROR
CLASSIFICATION, ARRAYS, LOOPS, CONDITIONALS, CLASSES,
INHERITANCE, POLYMORPHISM, INTERFACES, PACKAGES, AND THE
JAVA VIRTUAL MACHINE
1. What is the definition of Computer Science?
A) The study of computer hardware components
B) The study of the principles and use of computers
C) The study of programming languages only
D) The study of computer networking
Correct Answer: B
Rationale: Computer Science is defined as the study of the principles and use of
computers, encompassing both theoretical and practical aspects of computing.
2. What does IDE stand for in programming?
A) Integrated Development Environment
B) Internal Debugging Engine
C) Internet Development Entity
D) Interactive Design Environment
,Correct Answer: A
Rationale: IDE stands for Integrated Development Environment, a software
application that helps programmers write and debug Java programs more
efficiently.
3. Which company originally developed the first version of Java?
A) Oracle
B) Microsoft
C) Sun Microsystems
D) IBM
Correct Answer: C
Rationale: Sun Microsystems developed the original Java language. Oracle
acquired Sun and now owns Java.
4. Which company currently owns Java?
A) Sun Microsystems
B) Oracle
C) Microsoft
D) Google
Correct Answer: B
Rationale: Oracle purchased Sun Microsystems in 2010 and has owned Java since
then.
5. For what original purpose was Java initially written?
A) Web applets
B) Home appliances
C) Enterprise servers
,D) Mobile phones
Correct Answer: B
Rationale: Java began as a language for home appliances, though its focus later
shifted to other areas.
6. From which language is Java derived?
A) C++
B) C
C) C#
D) Pascal
Correct Answer: A
Rationale: Java syntax and object-oriented features were heavily influenced by
C++.
7. What is the output of the Java compiler called?
A) Source code
B) Executable code
C) Byte-code
D) Machine code
Correct Answer: C
Rationale: The Java compiler produces byte-code, which is a machine language for
a fictitious computer.
8. Is Java considered “statically typed” or “strongly typed”?
A) Dynamically typed
B) Weakly typed
C) Statically typed
, D) Untyped
Correct Answer: C
Rationale: Java is statically typed, meaning variable types are checked at compile
time.
9. Which type of error does the Java compiler detect?
A) Semantic errors
B) Logic errors
C) Syntax errors
D) Runtime errors
Correct Answer: C
Rationale: The Java compiler finds syntax errors (grammatical mistakes in code).
Semantic errors are only detected during execution.
10. What is a syntax error?
A) An error in the program’s logic
B) A grammatical error in word or punctuation
C) An error that occurs when the program runs
D) An error in variable naming
Correct Answer: B
Rationale: Syntax errors are grammatical mistakes in the code, such as missing
semicolons or misspelled keywords.
11. What is a semantic error?
A) An error that violates the language’s grammar rules
B) An error in the meaning or logic of the program
C) An error that prevents compilation