Features of Java
Features of Java
Features of Java
Features of Java
1. Java is Simple:
Its coding style is very clean and easy to understand.
2. Compiled and Interpreted
Uses both compiler and interpreter to translate the
language to machine code.
3. Platform Independent
This is where the "Write Once, run anywhere" motto for
Java comes in. It means that you can develop on one
environment(Operating System) and run on another
environment without doing any modification of the
Java achieves platform independence by using the
concept of the BYTE code.
Features of Java
4. Portable
Java programs can execute in any environment
(Linux, Window,Mac etc.) for which there is a Java
run-time system (JVM).
5. Architectural Neutral
Java application runs the same bytecodes regardless
of any environment (Operating System).
6. Object-Oriented
Java strongly supports the concepts of Object-
Oriented Programming Java supports major Object-
Oriented programming features like Encapsulation,
Abstraction, Polymorphism and Inheritance.
Features of Java
7. Robust
Robust simply means strong. Its capability to
handle Run-time Error, automatic garbage
collection.
8. Secure
The Java platform is designed with security
features built into the language and runtime
system more secure.
9. Distributed
Java is distributed because it encourages users to
create distributed applications. In Java, we can
split a program into many parts and store these
parts on different computers..
Features of Java
10. Multi Threading:
Java supports Multithreading means handling
more than one job at a time, so get more process
get done in less time than it could with just one
thread.
11. Dynamic and Extensible
Java is dynamic and extensible means with the help
of OOPs, we can add classes and add new methods
to classes, creating new classes through subclasses.
12. High Performance:
Although Java is an interpreted language, it was designed to
support "just-in-time" compilers, which dynamically compile
bytecodes to machine code. Bytecodes are highly optimized, so
Java Virtual Machine can executed them much faster.
Exercise
• Name two types of Java programs.
• Name any four features of Java language.
• Explain Stand alone applications.
• What are Java Applets?
• What is Java Byte code?
• What makes Java language platform
independent? Explain.
• Name the Java compiler and interpreter.
• What is JVM?
• What do you understand by Java library ?
Java Character set
Java Charset
• The character set is a set of alphabets, letters and some
special characters that are valid in Java language. The
smallest unit of Java language is the characters need to
write java tokens. These character set are defined by
Unicode character set.
Alphabets
C abd Java accepts both lowercase and uppercase alphabets as
variables and functions.
Uppercase: A B C ................................... X Y Z Lowercase: a b c
...................................... x y z
Digits
0123456789
Java Character set
Special Characters
+ _ ( ) { } [ ] \ | / > < ; etc.
White Spaces
Tab Or New line Or Space
Escape Sequences
A character preceded by a backslash (\) is an escape
sequence and has special meaning to the compiler. The
following table shows the Java escape sequences:
When an escape sequence is encountered in a print statement,
the compiler interprets it accordingly. For example, if you want to
put quotes within quotes you must use the escape sequence, \",
on the interior quotes
Java Character set
Escape Sequences
Escape
Description
Sequence
\t Insert a tab in the text at this point.
\b Insert a backspace in the text at this point.
\n Insert a newline in the text at this point.
\r Insert a carriage return in the text at this point.
\f Insert a formfeed in the text at this point.