Here are definitions of the terms as they relate to Java:
Hardware: The physical components of a computer, such as the CPU, memory, and storage.
Program: A set of instructions that a computer follows to perform a task.
Software: The collection of programs that control hardware and execute tasks.
Programming Language: A formal set of instructions that a computer can execute.
JAVA Programming Language: A high-level, object-oriented language that is platform-independent due to the Java Virtual Machine (JVM).
Identifiers: Names used for variables, methods, classes, etc.
Legal Identifiers: Must start with a letter, underscore, or dollar sign and cannot be a Java keyword.
Spaces, tabs, and newlines that improve readability but do not affect execution.
The process of designing, writing, testing, and maintaining a program.
Levels of programming abstraction: Machine language, Assembly, High-level language (e.g., Java).
Converting Java source code into bytecode using the Java compiler.
The process where Java source code is compiled into bytecode and then interpreted by the JVM.
Tools used for Java programming (e.g., Eclipse, IntelliJ, NetBeans).
Syntax: The rules governing the structure of valid Java code.
Semantics: The meaning of Java statements.
Syntax Errors: Violations of Java's rules (e.g., missing semicolons).
Runtime Errors: Errors occurring during execution (e.g., division by zero).
Logical Errors: Incorrect logic leading to undesired output.
The process of designing a solution and implementing it in code.
Steps in creating a program: analysis, design, coding, testing, debugging.
A programming paradigm based on objects and classes.
Instances of a class containing attributes (fields) and behaviors (methods).
Blueprints for creating objects.
Classes define object properties; objects are instances of classes.
Sequences of characters handled by the String
class.
Using string literals: String s = "Hello";
Using new
: String s = new String("Hello");
System.out.print()
: Prints without a newline.
System.out.println()
: Prints with a newline.
Combining strings using +
: "Hello" + " World"
results in "Hello World"
.
Special characters (\n
, \t
, \\
, etc.).
Named storage locations in memory.
Assigning values using =
.
Immutable values declared with final
.
byte
, short
, int
, long
, float
, double
, char
, boolean
.
Integer (int
, long
) and floating-point (float
, double
).
Represented using char
, e.g., char c = 'A';
.
true
or false
values.
Combinations of variables, operators, and values.
/
for division, %
for remainder.
Assigning values with operators (+=
, -=
, etc.).
++
and --
increase or decrease a variable by 1.
=
, +=
, -=
, *=
, /=
, %=
.
Assignment Conversion: Implicit conversion in assignments.
Promotion: Widening conversion (e.g., int
to double
).
Casting: Explicit conversion using (type)
.
Used for input reading (Scanner sc = new Scanner(System.in);
).
Methods like nextInt()
, nextDouble()
, nextLine()
.
Individual units of input parsed by Scanner
.
ClassName obj = new ClassName();
Using literals.
Using new
.
Calling methods on objects: obj.method();
.
Variables storing memory addresses of objects.
Assigning references, not copying objects.
Multiple references to the same object.
Methods like length()
, substring()
, toUpperCase()
.
Predefined Java libraries.
import java.util.Scanner;
.
java.lang
PackageImplicitly imported (contains Math
, String
, etc.).
Generates random numbers (Random rand = new Random();
).
Convert primitives to objects (Integer
, Double
, etc.).
Automatic conversion between primitives and wrapper objects.
A collection of elements of the same type.
int[] arr;
.
Access elements with indices.
Java prevents accessing indices out of range.
int arr[];
.
int[] arr = {1, 2, 3};
.
int[][] matrix = new int[3][3];
.
Pros: Fast access, easy iteration.
Cons: Fixed size, memory overhead.
A subclass inherits attributes and methods from a superclass.
Words: Noun
extends Word
.
Book: Ebook
extends Book
.
Hospital Employee: Doctor
extends Employee
.
protected
ModifierAllows subclass access but prevents outside access.
super
ReferenceCalls superclass constructor/methods.
Overloading: Same method name, different parameters.
Overriding: Redefining superclass methods in a subclass.
Organized structure of classes.
Object
ClassThe root of all Java classes.
Cannot be instantiated; contains abstract methods.
public
, private
, protected
.
Using super
and protected
members.
The association of a method call with its definition.
The ability of a method to take different forms.
A superclass reference can hold a subclass object.
Subclasses can override superclass methods and be referenced polymorphically.
Let me know if you need further clarification on any term!