Please enable JavaScript.
Coggle requires JavaScript to display documents.
2.1 Java terminology and environment - Coggle Diagram
2.1 Java terminology and environment
Introduction to Java
Object Oriented Programming (OOP) language.
Simple and easy to understand.
runs on a wide variety of operating environments.
Java technology
As programming language.
As development environment.
As application environment.
Java architecture
Java source code
Program written in the form of text using Java.
Java compiler
Used to convert source code into binary program that consists of byte code. It creates .class file.
Java bytecode (Object code)
Bytecode is a set of instructions that are machine-independent. Executed by JVM.
Java Virtual Machine (JVM)
Is a Java runtime system. Converts the bytecode in .class file to machine language.
Key concept of Java
Platform-Independent
Java programs written in one environment can run on all other environments.
Object-Oriented
To design programs close to the real world.
Distributed
Powerful language.
To share and access data across the net.
Secure
Highly secure programming language.
Simple
Easy to learn and use.
Portable
Bytecode and basic data types in Java makes it compatible.
Multi-threaded
To handle many tasks simultaneously.
Robust
Early and dynamic checking during runtime eliminates situations that cause errors.
Reliable.
Anatomy of Java program
Comment
Two slashes (//) in a line, or enclosed between /
and
/ in one or multiple lines.
Sees //, it ignores all text after // in the same line.
Sees /
, it scans for the next
/ and ignores any text between /
and
/.
Reserved Word
Specific meaning to the compiler.
Cannot be used for other purposes in the program.
Modifiers
Specify the properties of the data, methods, and classes.
Ex: public and static.
Statements
An action or a sequence of actions.
Ex: System.out.println("Welcome to Java!") is to display the greeting "Welcome to Java!" .
All statement ends with semicolon(;)
Blocks
Forms a block that groups components of a program.
Classes
Template or blueprint for objects.
Essential Java construct.
Method
Performs a sequence of operations to display a message.
Main Method
The main() method must be declared to be public and static.
Style and convention
Block styles
Appropriate comments and comments style
Single-Line Comments
End-Of-Line Comments
Block Comments
Naming conventions
Start with a character (A-Z, a-z), an underscore (_) or a dollar sign ($).
Keywords cannot be used as identifiers.
Special characters like #, !, @ and ^ cannot be used.
Proper indention and spacing
Two spaces should be used