1. Java is Object-Oriented • Object-oriented programming provides great flexibility, modularity, clarity, and reusability through encapsulation, inheritance, and polymorphism. 2. Java Is Distributed • Distributed computing involves several computers working together on a network. • Java is designed to make distributed computing easy as networking capability is inherently integrated into Java. • Thus, writing network programs is like sending and receiving data to and from a file. CHARACTERISTICS OF JAVA
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1. Java is Object-Oriented
• Object-oriented programming provides great flexibility, modularity, clarity, and
reusability through encapsulation, inheritance, and polymorphism.
2. Java Is Distributed
• Distributed computing involves several computers working together on a network.
• Java is designed to make distributed computing easy as networking capability is
inherently integrated into Java.
• Thus, writing network programs is like sending and receiving data to and from a
file.
CHARACTERISTICS OF JAVA
3. Java Is Interpreted
• You need an interpreter to run Java programs.
• The programs are compiled into the Java Virtual Machine code called bytecode.
• The bytecode is machine-independent and can run on any machine that has a Java
interpreter, which is part of the Java Virtual Machine (JVM).
4. Java Is Robust
• Java compilers can detect many problems that would first show up at execution
time in other languages.
• Java has a runtime exception-handling feature to provide programming support
for robustness.
CHARACTERISTICS OF JAVA
5. Java Is Secure
• Java implements several security mechanisms to protect your system against
harm caused by stray programs.
6. Java Is Architecture-Neutral
• Write once, run anywhere. With a Java Virtual Machine (JVM), you can write one
program that will run on any platform.
7. Java Is Portable
• They can be run on any platform without being recompiled.
CHARACTERISTICS OF JAVA
Set path to JDK bin directory
set path=c:\Program Files\java\jdk1.6.0\bin
Set classpath to include the current directory
set classpath=.
Compile
javac Welcome.java
Run
java Welcome
COMPILING AND RUNNING JAVA FROM THE CMD
Right click My Computer.
Choose Properties from the context menu.
Click the Advanced system settings link.
Go to Advanced tab. Click Environment Variables.
In the section System Variables, find the PATH environment variable and
select it. Click Edit.
If the PATH environment variable does not exist, click New.
In the Edit System Variable (or New System Variable) window, specify
the value of the PATH environment variable.
Click OK. Close all remaining windows by clicking OK.
SETTING PATH AND CLASSPATH DIRECTLY IN WINDOWS 7
After installation, the JDK directory will have the structure shown below.
C:\Java\jdk1.7.0\bin\ //contains both the compiler and the launcher.
The PATH environmental variable contains the path of the executables (javac.exe,
java.exe, javadoc.exe, and so on)
The CLASSPATH variable is one way to tell applications, including the JDK tools, where
to look for user classes.
After setting the PATH variable, we can access these executables (compiler, launcher
etc) from any directory without having to type the full path of the command. For e.g.
javac Example.java - If the PATH is set, then we use following in CMD