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 :
It is simple and easy to understand.
It runs on a wide variety of operating environments.
Java is a Object Oriented Programming (OOP) language.
It is a powerful and popular language to develop Internet applications.
Java Architecture
Java is platform-independent as it can run on a wide variety of computers using different OS.
Components in Java Architecture
1) Java source code
Program written in the form of text using Java.
2) Java compiler
Used to convert source code into binary program that consists of byte code. It creates .class file.
3) Java bytecode (Object code)
Bytecode is a set of instructions that are machine-independent. Executed by JVM
4) Java Virtual Machine (JVM)
Is a Java runtime system. Converts the bytecode in .class file to machine language.
Key concept of Java
Features of Java
Dynamic
Distributed
Robust
High Performance
Interpreted
Objectoriented
Portable
Multithreaded
Simple and secure
Architectural neutral
C++ and Java Comparison
C++ supports pointers, structures, complex functions concepts while
Java does not support pointers, structures and complex functions concepts
C++ supports multiple inheritance where else
Java does not support multiple inheritance and it can be supported through interface feature
C++ supports ASCII char set where else
Java supports Unicode char set
Java Technology
As development environment
As application environment
As a programming language
Anatomy of Java Program
Reserved Word
a specific meaning to the compiler and cannot be used for other purposes in the program
Comments
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
/
Modifier
uses certain reserved words called modifiers that specify the properties of the data, methods, and classes and how they can be used
Statement
an action or a sequence of actions
Every statement in Java ends with a semicolon (;)
Blocks { }
that groups components of a program
Classes
a template or blueprint for objects
Method
a collection of statements that performs a sequence of operations to display a message on the console
Main method
The name main is distinguished in that it is the name of the method which the Java interpreter will execute first, regardless of where it occurs in the program
The main() method must be declared to be public and static
Style and Convention
Comment Style
Block comments
Single-Line comments
End-Of-Line comments
Naming Convention
An identifier must start with a character (A-Z, a-z), an underscore (_) or a dollar sign ($)
The special characters such as #, !, @ and ^ cannot be used
Blank and tab space cannot be used
Keywords listed in Java cannot be used as identifiers
Constants should be capitalized with words separated by an underscore (_)
Indentation and Spacing
Two spaces should be used
Block Styles