Java Topics Simple Answers
Java Topics Simple Answers
What is Java?
Java is a high-level, object-oriented programming language used to build applications. It is
platform-independent, meaning it can run on any system with a Java Virtual Machine (JVM).
Programming Language
A way to communicate instructions to a computer to perform specific tasks.
Translators
Tools that convert code from one language to another.
Compiler
A program that translates the entire code at once before execution.
Interpreter
A program that translates and runs code line by line.
Java Process
Write code → Compile with javac → Run with java command on JVM.
What is Data?
Data is information or values used and processed by a program.
Data Type
The kind of data a variable can hold, like numbers or text.
Operations
Actions performed on data like printing or storing.
Printing Operation
Displaying information on the screen using System.out.println().
Storage Operation
Saving data in variables for later use.
Keywords
Reserved words in Java with special meanings like int, if, class.
Identifiers
Names for variables, methods, classes, etc.
Naming Conventions
Rules for naming variables and classes.
Pascal Casing
First letter of every word is capital (Example: StudentName).
Camel Casing
First word starts with lowercase, other words start with uppercase (Example:
studentName).
Variable
A container that holds data values.
Operator
A symbol that performs operations on variables and values.
Operand
The values or variables on which operators work.
Types of Operators
Categories of operators like arithmetic, relational, logical, etc.
ASCII Values
Numerical values for characters (A=65, a=97).
List of Operators
Includes Arithmetic, Relational, Logical, Assignment, Conditional, Increment/Decrement,
Combinational, and Bitwise Operators.
Conditional Statements
Statements like if, if-else, switch to make decisions.
Looping Statements
Statements like for, while, do-while to repeat actions.
Standard Programs
Common examples like Spy number, Perfect number, Prime number, Palindrome,
Armstrong number, etc.
Method
A block of code that performs a task.
Pre-defined Methods
Built-in Java methods like length(), println().
User-defined Methods
Methods created by the programmer.
Method Recursion
A method calling itself to solve a problem.