Java Programming: Key Concepts and Terminology
Core Java Terminology:
- Variable
- User
- Iteration
- Repetition
- Body
- Comments
- String
- Double
- Binary Numbering System
- Decimal Numbering System
- Implicit Promotion
- Cast
- Static
- Private
- New
- Final
- Constructor
- Return Statement
- Format Specifier
- Assembly Code
- Java Virtual Machine (JVM)
- Source Code File
- Object
- Identifier
- Method
- Modification
- Sequential
- Boolean Expression
- Block
- Statement
- Float
- Character
- Octal Numbering System
- Compiler
- Class
- Bool
- Public
- Return Type
- Concatenation
- Call by/Pass by Value
- Set/Get Methods
- Initialization
- Format Control String
- Machine
Java GUI Programming Tips
Java GUI FAQ
Inner Classes and Compilation
Q: After compiling a Java program called Mike, a Mike$1.class file appears. What’s this?
A: This indicates an anonymous inner class.
Painting Components
Q: How do you call the paint(Graphics g)
method in a JComponent
(like JPanel
) to redraw it?
A: Indirectly, using the repaint()
method.
Adding Multiple Buttons
Q: How can multiple buttons be added to a Frame
and displayed?
A: Add a JPanel
to the Frame
, then add the buttons to the JPanel
.
Handling Button Clicks
Q: When
Read MoreJava Multithreading: Concepts, Synchronization, and Communication
What is a Thread?
In computer programming, a thread is a fundamental unit of execution within a process. It’s a lightweight subprocess that shares the same memory space as its parent process. Multiple threads can run concurrently within a single process, allowing for parallel execution of tasks.
Ways to Create Threads in Java
Implementing the Runnable Interface:
- Create a class that implements the
Runnable
interface. - Implement the
run()
method, which contains the code to be executed by the thread. - Instantiate