Sunday, 9 February 2014

Basic of Java

What is Java?

Java is a programming language and a platform.

Platform Any hardware or software environment in which a program runs, known as a platform. Since Java has its own Runtime Environment (JRE) and API, it is called platform.

Where it is Used ?

1.Desktop Application.(e.g Antivirus,converter,media player)
2.Web Application.(tnpsc,irctc.com..etc)
3.Enterprise Application (banking application)
4.Mobile 
5.Embedded System
6.Smart card 
7.Robotics
8.Games etc..

Java Application Types

                   1.Standalone Application.
                   2.Web Application
                   3.Enterprise Application
                   4.Mobile Application

  History of Java

  •             James Gosling, Mike Sheridan, and Patrick Naughton initiated the Java language project in June 1991. The small team of sun engineers called Green Team
  •          Originally designed small embedded system in electronic appliances like set-top boxes.
  •          First java was called "Greentalk" by James Gosling and file extension was .gt
  •         After that it was called  Oak and was developed as a part of Green project 

 Why Oak name for java?

  • Why Oak? Oak is a symbol of strength and choosen as a national tree of many countries like U.S.A., France, Germany, Romania etc. 

 

Why Name for java ?

  •       Java is an island of Indonesia where first coffee was produced called java coffee.
  •       Java is a name ,not having any abbreviation.

Java Version List

  • JDK Alpha and Beta (1995)
  • JDK 1.0 (23rd Jan, 1996)
  • JDK 1.1 (19th Feb, 1997)
  • J2SE 1.2 (8th Dec, 1998)
  • J2SE 1.3 (8th May, 2000)
  • J2SE 1.4 (6th Feb, 2002)
  • J2SE 5.0 (30th Sep, 2004)
  • Java SE 6 (11th Dec, 2006)
  • Java SE 7 (28th July, 2011)

Saturday, 8 February 2014

Features of Java

Features of Java

       There is give many feature :
                           1.Simple
                           2. Object Oriented
                           3.Platform Independent
                           4.Secured
                           5.Robust
                          6.Portable
                          7.Dynamic
                          8.Interpreted
                          9.High performance
                        10.Multithreading
                        11.Distributed

Object Oriented

  • Object-oriented means we organize our software as a combination of different types of objects that incorporates both data and behaviour.
  • Object-oriented programming(OOPs) is a methodology that simplify software development and maintenance by providing some rules.
  • Basic concepts of OOPs are:
  1. Object
  2. Class
  3. Inheritance
  4. Polymorphism
  5. Abstraction
  6. Encapsulation
Platform Independent
       There are 2 types of platforms software-based platform and hardware-based platform 
       It has two components:
                              1.Run time Environment
                              2.API (Application Programming Interface)
       Java code can run any platform e.g Windows, Linux,Sun solaris,Mac etc..
  • Java code compile by compiler and convert into byte code. 
  • This byte code can run any platform it is platform independent.Write Once Run Any Where(WORA).






































































































































































































































Friday, 7 February 2014

Java Secured


Secured 
  •         Program run inside java virtual machine
  •         There is No Explicit pointer
  •         We can't able to change byte code



  • Classloader- adds security by separating the package for the classes of the local file system from those that are imported from network sources.
  • Bytecode Verifier- checks the code fragments for illegal code that can violate access right to objects.
  • Security Manager- determines what resources a class can access such as reading and writing to the local disk.

Robust

  • Robust simply means strong. Java uses strong memory management. There are lack of pointers that avoids security problem. 
  • There is automatic garbage collection in java. 
  • There is exception handling and type checking mechanism in java. All these points makes java robust.
Portable
  •         Using byte code you can run any platform. 


High Performance 

  •     Java is fast performance language compare with any language like C,C++
Distributed 
  •  We can able to create distributed application in java by using EJB and RMI . We may access file calling  method from any machine on internet
Multi-Threaded 
  •   Thread is executed separate program.multi thread can use to execute multiple process and execute concurrently. 
  • Thread to share same memory  and execute different process. Thread is important for multi-media and web application.
  •  

Thursday, 6 February 2014

First Java Program

What are requirement of simple Java Program ?
  1. You need to install JDK in your Computer,if not installed click to Download JDK and install it.
  2. You need to Set Path  
                 There are 2 way of Set Path
                                           1.Temporary Path
                                           2.Permanent
                               

               Temporary Path

                           1.Open the command prompt 
                           2. Copy the directory e.g c:\program files\java\jdk1\bin
                           3.Write in command prompt  e.g set path=c:\program files\java\jdk1\bin; 
    Let's See its given figure


                 Permanent Path

                          For Set Permanent path for JDK , you should follow this steps

          Go to My Computer(right click)-->Properties-->Advanced-->Environment variable-->new 

                           Set variable name and variable value
                               e.g:
                                     Variable Name :path
                                     Variable Vlaue :C:/Program Files/java/jdk1.7/bin; 

  Let's See Given figure :

      

                       

                 






Let's See the given figure 
         To cop the path from the address bar and paste into the variable value text box.







  After Set your variable name and Variable Value click-->OK-->OK-->OK.


    Now Open a command prompt and no need to set path . we can directly compile and run the Java program.

    

Wednesday, 5 February 2014

Internal Details in Java Program


What happen in Compile time ?
 
                       At compile time , Java file compiled my Java Compiler. The Java Compiler does not interact with OS and Java Source code to convert Java byte code.






 What happen in Run time ?