1/39
Flashcards covering core Java concepts, OOP principles, syntax, data types, control structures, and exception handling based on the COS202 course transcript.
Object Oriented Programming (OOP)
A programming paradigm based upon objects having both data and methods that aims to incorporate the advantages of modularity and reusability.
Procedure Oriented Programming (POP)
A programming approach where the problem is considered as a sequence of tasks to be done, written as a set of functions with primary focus on functions rather than data.
James Gosling
One of the individuals at Sun Microsystems, Inc. who conceived the Java programming language in 1991.
Package
The Java language's namespace mechanism used to group similar types of classes, interfaces, and subpackages.
Java Development Kit (JDK)
The software environment used to develop Java applications, which must be downloaded according to the user's operating system.
.java
The disk file extension used for storing programs written in a text editor or Integrated Development Environment (IDE).
Java Virtual Machine (JVM)
The Java interpreter that converts bytecodes (.class files) into the machine language of the particular computer.
Identifier
A series of characters consisting of letters, digits, underscores (_), and dollar signs ($) that cannot begin with a digit or contain spaces.
Keywords
Reserved words in Java, such as abstract, class, and public, which are always spelled with lowercase letters and cannot be used as identifiers.
Javadoc Comments
Special comments starting with /∗∗ and ending with ∗/ used for generating HTML documentation for Java programs.
Byte
A primitive data type consisting of an 8-bit signed two's complement integer.
Int
A primitive data type consisting of a 32-bit signed two's complement integer.
Boolean
A primitive data type representing 1 bit of information.
Char
A primitive data type consisting of a single 16-bit Unicode character.
Local Variables
Variables declared in methods, constructors, or blocks that are created when the block is entered and destroyed once it is exited.
Instance Variables
Variables declared in a class but outside methods; they are created when an object is created with new and destroyed when the object is destroyed.
Class Variables
Also known as static variables, these are declared with the static keyword; only one copy exists per class regardless of the number of objects created.
Conditional Operator (?:)
Also known as the ternary operator, it consists of three operands and is used to evaluate Boolean expressions to decide which value to assign to a variable.
instanceof Operator
An operator used only for object reference variables to check whether an object is of a particular class or interface type.
Sequential Execution
The process where statements in a program are executed one after the other in the order in which they are written.
Transfer of Control
A process enabled by various Java statements where the next statement to execute is not the next one in sequence.
Switch Statement
A multiple-selection statement that performs one of many different actions depending on the value of an expression.
Enhanced for Statement
A repetition statement that iterates through the elements of an array without using a counter.
Encapsulation
The technique of making fields in a class private and providing access via public methods, also referred to as data hiding.
Data Abstraction
The ability to declare a class as abstract, meaning it cannot be instantiated and serves as a superclass for other classes.
Polymorphism
The ability of an object to take on many forms, typically occurring when a parent class reference is used to refer to a child class object.
Method Overloading
When a class has two or more methods with the same name but different parameters.
Inheritance
The process where one object acquires all the properties and behaviors of a parent object, represented by the IS-A relationship.
Aggregation
A HAS-A relationship where a class contains an entity reference to another class.
Interface
A blueprint of a class containing static constants and abstract methods used to achieve full abstraction and multiple inheritance.
Marker Interface
An interface that has no members, such as Serializable or Cloneable, used to provide essential information to the JVM.
Exception
An indication of a problem that occurs during a program’s execution, allowing applications to resolve problems and continue executing or terminate gracefully.
Stack Trace
Information displayed when an exception occurs, including the exception name, a descriptive message, and the method-call stack at the time of the error.
Checked Exception
Exceptions that are checked at compile-time by the Java compiler, such as IOException and SQLException.
Unchecked Exception
Exceptions that extend RuntimeException and are checked at runtime, such as ArithmeticException and NullPointerException.
finally Block
An optional block that follows try or catch blocks and always executes whether or not an exception is thrown, typically containing resource-release code.
throw Keyword
A keyword used to explicitly throw an exception, mainly used to throw custom exceptions.
throws Keyword
A keyword used in a method signature to declare the types of exceptions a method might throw.
Array
A sequence of variables containing values of the same type, considered as objects and reference types in Java.
JOptionPane
A class in the javax.swing package used to pop up standard dialog boxes for user input or information.