Core Java Fundamentals Interview Questions
Basic Java concepts, JVM, JDK, JRE, data types, operators, and language fundamentals.
- 20Questions with answers
- 3Difficulty levels
Questions (20)
Browse beginner, intermediate, and advanced questions with answers — hide them when you want to self-test.
What are the main features of Java?
Java provides platform independence, object-oriented programming, robustness, security, multithreading, distributed computing support, automatic memory management, and high performance through JIT compilation.
Why is Java platform independent?
Java is platform independent because Java source code is compiled into bytecode, which can run on any operating system that has a compatible JVM installed.
What is JVM?
JVM (Java Virtual Machine) is a runtime environment that executes Java bytecode. It provides platform independence and manages memory, garbage collection, and execution.
What is JRE?
JRE (Java Runtime Environment) contains the JVM and required libraries needed to run Java applications but does not include development tools.
What is JDK?
JDK (Java Development Kit) includes JRE along with development tools such as javac, java, javadoc, and debugger utilities required to develop Java applications.
Explain the Java execution process.
Java source code is compiled by javac into bytecode. The JVM loads the bytecode, verifies it, and executes it using the interpreter and JIT compiler.
What is the difference between Java and C++?
Java is platform independent, supports automatic garbage collection, and does not support multiple inheritance through classes, whereas C++ is platform dependent and provides manual memory management.
What are primitive data types in Java?
Java has eight primitive data types: byte, short, int, long, float, double, char, and boolean.
What is type casting?
Type casting is the process of converting a value from one data type to another. It can be implicit or explicit.
What is the difference between implicit and explicit casting?
Implicit casting is performed automatically when converting a smaller type to a larger type, while explicit casting requires manual conversion from a larger type to a smaller type.
What are operators in Java?
Operators are symbols used to perform operations on variables and values. Examples include arithmetic, relational, logical, assignment, bitwise, and ternary operators.
What is the difference between == and equals()?
The == operator compares object references, while equals() compares object content when properly overridden.
What are command-line arguments?
Command-line arguments are values passed to a Java program through the main method parameter String[] args during execution.
What is Unicode in Java?
Unicode is a universal character encoding standard used by Java to support internationalization and represent characters from multiple languages.
What is bytecode?
Bytecode is the intermediate code generated by the Java compiler. It is platform independent and executed by the JVM.
Which Java language or JDK features are essential when discussing Core Java Fundamentals?
Name concrete APIs (collections, concurrency, streams, annotations) tied to Core Java Fundamentals. Interviewers want syntax-level clarity plus when you would reach for each feature in production.
How does exception handling typically work around Core Java Fundamentals in Java?
Prefer specific checked/unchecked exceptions, wrap lower-level failures with context, and avoid empty catch blocks. For Core Java Fundamentals, decide what is recoverable vs fatal to the request thread.
What unit-testing approach would you use for Core Java Fundamentals?
JUnit 5 with Arrange-Act-Assert, Mockito for collaborators, and parameterized tests for edge cases. Keep Core Java Fundamentals logic pure where possible so tests stay fast.
How do equals/hashCode or identity rules affect Core Java Fundamentals?
Incorrect equals/hashCode break HashMap/HashSet behavior. If Core Java Fundamentals stores objects in collections, explain the contract and mutability pitfalls.
What memory or GC concern should juniors watch with Core Java Fundamentals?
Retain only needed references, prefer streaming for large datasets, and avoid accidental caches. Relate leaks or GC pressure to a concrete Core Java Fundamentals scenario.
Practice with AI mock interviews
Run Java mock interviews with AI follow-ups, instant feedback, and analytics on AiLx.
Free to start · No credit card required