CHARACTERISTICS OF JAVA
Simple :
 Java is Easy to write and more readable.
 Java has a concise, cohesive set of features that makes it easy to learn and use.
 Most of the concepts are drawn from C++, thus making Java learning simpler.
Secure :
 Java program cannot harm other system thus making it secure.
 Java provides a secure means of creating Internet applications.
 Java provides secure way to access web applications.
Portable :
 Java programs can execute in any environment for which there is a Java run-time
system.
 Java programs can run on any platform (Linux, Window, Mac)
 Java programs can be transferred over world wide web (e.g applets)
Object-oriented :
 Java programming is object-oriented programming language.
 Like C++, java provides most of the object oriented features.
 Java is pure OOP Language. (while C++ is semi object oriented)
Robust :
 Java encourages error-free programming by being strictly typed and performing run-
time checks.
Multithreaded :
 Java provides integrated support for multithreaded programming.
Architecture-neutral :
 Java is not tied to a specific machine or operating system architecture.
 Java is machine independent.
Interpreted :
 Java supports cross-platform code through the use of Java bytecode.
 Bytecode can be interpreted on any platform by JVM (Java Virtual Machine).
High performance :
 Bytecodes are highly optimized.
 JVM can execute bytecodes much faster .
Distributed :
 Java is designed with the distributed environment.
 Java can be transmitted over internet
Dynamic :
 Java programs carry substantial amounts of run-time type information with them that
is used to verify and resolve accesses to objects at run time.
JAVA RUNTIME ENVIRONMENT (JRE)
The Java Runtime Environment (JRE) is a set of software tools for development of Java
applications. It combines the Java Virtual Machine (JVM), platform core classes and
supporting libraries.
JRE is part of the Java Development Kit (JDK), but can be downloaded separately. JRE
was originally developed by Sun Microsystems Inc., a wholly-owned subsidiary of Oracle
Corporation.
JRE consists of the following components:
Name of the component Elements of the component
Deployment technologies Deployment
Java Web Start
Java Plug-in
User interface toolkits Abstract Window Toolkit (AWT)
Swing
Java 2D
Accessibility
Image I/O
Print Service
Sound
Drag and Drop (DnD)
Input methods.
Integration libraries Interface Definition Language (IDL)
Java Database Connectivity (JDBC)
Java Naming and Directory Interface (JNDI)
Remote Method Invocation (RMI)
Remote Method Invocation Over Internet
Inter-Orb Protocol (RMI-IIOP)
Scripting.
base libraries International support
Input/Output (I/O)
Eextension mechanism
Beans
Java Management Extensions (JMX)
Java Native Interface (JNI)
Math
Networking
Override Mechanism
Security
Serialization and Java for XML Processing
(XML JAXP).
Lang and util base libraries lang and util
Management
Versioning
Zip
Instrument
Reflection
Collections
Concurrency
Java Archive (JAR)
Logging
Preferences API
Ref Objects
Regular Expressions.
Java Virtual Machine (JVM) Java HotSpot Client
Server Virtual Machines
JAVAVIRTUALMACHINE (JVM)
The JVM is a program that provides the runtime environment necessary for Java pro-
grams to execute. Java programs cannot run without JVM for the appropriate hardware and OS
platform.
Java programs are started by a command line, such as:
java <arguments> <program name>
This brings up the JVM as an operating system process that provides the Java runtime
environment. Then the program is executed in the context of an empty virtual machine.
When the JVM takes in a Java program for execution, the program is not provided as Java
language source code. Instead, the Java language source must have been converted into a
form known as Java bytecode. Java bytecode must be supplied to the JVM in a format called
class files. These class files always have a .class extension.
The JVM is an interpreter for the bytecode form of the program. It steps through one
bytecode instruction at a time. It is an abstract computing machine that enables a computer to
run a Java program.
SETTING UP AN ENVIRONMENT FOR JAVA
Local Environment Setup
Download Java and run the .exe to install Java on the machine.
Setting Up the Path for Windows
Assuming Java is installed in c:Program Filesjavajdk directory −
 Right-click on ‘My Computer’ and select ‘Properties’.
 Click the ‘Environment variables’ button under the ‘Advanced’ tab.
 Now, alter the ‘Path’ variable so that it also contains the path to the Java executable.
Example, if the path is currently set to ‘C:WINDOWSSYSTEM32’, then change
your path to read ‘C:WINDOWSSYSTEM32;c:Program Filesjavajdkbin’.
POPULAR JAVA EDITORS
To write Java programs, we need any of the following:
 Notepad − Text editor
 Netbeans − A Java IDE that is open-source and free
 Eclipse − A Java IDE developed by the eclipse open-source community

java basics.pptx

  • 1.
    CHARACTERISTICS OF JAVA Simple:  Java is Easy to write and more readable.  Java has a concise, cohesive set of features that makes it easy to learn and use.  Most of the concepts are drawn from C++, thus making Java learning simpler. Secure :  Java program cannot harm other system thus making it secure.  Java provides a secure means of creating Internet applications.  Java provides secure way to access web applications. Portable :  Java programs can execute in any environment for which there is a Java run-time system.  Java programs can run on any platform (Linux, Window, Mac)  Java programs can be transferred over world wide web (e.g applets) Object-oriented :  Java programming is object-oriented programming language.  Like C++, java provides most of the object oriented features.  Java is pure OOP Language. (while C++ is semi object oriented) Robust :  Java encourages error-free programming by being strictly typed and performing run- time checks. Multithreaded :  Java provides integrated support for multithreaded programming. Architecture-neutral :  Java is not tied to a specific machine or operating system architecture.  Java is machine independent. Interpreted :  Java supports cross-platform code through the use of Java bytecode.  Bytecode can be interpreted on any platform by JVM (Java Virtual Machine). High performance :  Bytecodes are highly optimized.  JVM can execute bytecodes much faster . Distributed :  Java is designed with the distributed environment.  Java can be transmitted over internet
  • 2.
    Dynamic :  Javaprograms carry substantial amounts of run-time type information with them that is used to verify and resolve accesses to objects at run time. JAVA RUNTIME ENVIRONMENT (JRE) The Java Runtime Environment (JRE) is a set of software tools for development of Java applications. It combines the Java Virtual Machine (JVM), platform core classes and supporting libraries. JRE is part of the Java Development Kit (JDK), but can be downloaded separately. JRE was originally developed by Sun Microsystems Inc., a wholly-owned subsidiary of Oracle Corporation. JRE consists of the following components: Name of the component Elements of the component Deployment technologies Deployment Java Web Start Java Plug-in User interface toolkits Abstract Window Toolkit (AWT) Swing Java 2D Accessibility Image I/O Print Service Sound Drag and Drop (DnD) Input methods. Integration libraries Interface Definition Language (IDL) Java Database Connectivity (JDBC) Java Naming and Directory Interface (JNDI) Remote Method Invocation (RMI) Remote Method Invocation Over Internet Inter-Orb Protocol (RMI-IIOP) Scripting.
  • 3.
    base libraries Internationalsupport Input/Output (I/O) Eextension mechanism Beans Java Management Extensions (JMX) Java Native Interface (JNI) Math Networking Override Mechanism Security Serialization and Java for XML Processing (XML JAXP). Lang and util base libraries lang and util Management Versioning Zip Instrument Reflection Collections Concurrency Java Archive (JAR) Logging Preferences API Ref Objects Regular Expressions. Java Virtual Machine (JVM) Java HotSpot Client Server Virtual Machines
  • 4.
    JAVAVIRTUALMACHINE (JVM) The JVMis a program that provides the runtime environment necessary for Java pro- grams to execute. Java programs cannot run without JVM for the appropriate hardware and OS platform. Java programs are started by a command line, such as: java <arguments> <program name> This brings up the JVM as an operating system process that provides the Java runtime environment. Then the program is executed in the context of an empty virtual machine. When the JVM takes in a Java program for execution, the program is not provided as Java language source code. Instead, the Java language source must have been converted into a form known as Java bytecode. Java bytecode must be supplied to the JVM in a format called class files. These class files always have a .class extension. The JVM is an interpreter for the bytecode form of the program. It steps through one bytecode instruction at a time. It is an abstract computing machine that enables a computer to run a Java program. SETTING UP AN ENVIRONMENT FOR JAVA Local Environment Setup Download Java and run the .exe to install Java on the machine. Setting Up the Path for Windows Assuming Java is installed in c:Program Filesjavajdk directory −  Right-click on ‘My Computer’ and select ‘Properties’.  Click the ‘Environment variables’ button under the ‘Advanced’ tab.  Now, alter the ‘Path’ variable so that it also contains the path to the Java executable. Example, if the path is currently set to ‘C:WINDOWSSYSTEM32’, then change your path to read ‘C:WINDOWSSYSTEM32;c:Program Filesjavajdkbin’. POPULAR JAVA EDITORS To write Java programs, we need any of the following:  Notepad − Text editor  Netbeans − A Java IDE that is open-source and free  Eclipse − A Java IDE developed by the eclipse open-source community