Java was created in 1991 by James Gosling and others at Sun Microsystems. It was initially called Oak but renamed to Java in 1995. Java is similar to C++ but aims to be simpler, safer, and platform independent. Java code can run on any device that has a Java Virtual Machine (JVM) without needing to be recompiled. The Java programming language and its platforms include Java SE for core functionality, Java EE for enterprise applications, Java ME for small devices, and JavaFX for rich internet applications. All Java platforms provide a JVM and APIs to allow platform-independent applications.
Java was created in 1991 by James Gosling and others at Sun Microsystems. It was initially called Oak but renamed to Java in 1995. Java is similar to C++ but aims to be simpler, safer, and platform independent. Java code can run on any device that has a Java Virtual Machine (JVM) without needing to be recompiled. The Java programming language and its platforms include Java SE for core functionality, Java EE for enterprise applications, Java ME for small devices, and JavaFX for rich internet applications. All Java platforms provide a JVM and APIs to allow platform-independent applications.
Java was created in 1991 by James Gosling and others at Sun Microsystems. It was initially called Oak but renamed to Java in 1995. Java is similar to C++ but aims to be simpler, safer, and platform independent. Java code can run on any device that has a Java Virtual Machine (JVM) without needing to be recompiled. The Java programming language and its platforms include Java SE for core functionality, Java EE for enterprise applications, Java ME for small devices, and JavaFX for rich internet applications. All Java platforms provide a JVM and APIs to allow platform-independent applications.
Naughton, Chris Warth, Ed Frank, and Mike Sheridan at Sun Microsystems, Inc. in 1991 • This language was initially called “Oak,” but was renamed “Java” in 1995. • Java is related to C++, which is a direct descendant of C. Much of the character of Java is inherited from these two languages. • Java programs are platform independent which means they can be run on any operating system with any processor as long as the Java interpreter is available on that system. • Java code that runs on one platform does not need to be recompiled to run on another platform; it's called write once, run anywhere(WORA). • Java Virtual Machine(JVM) executes Java code, but it has been written in platform-specific languages such as C/C++, etc. JVM is not written in Java and hence cannot be platform independent. • Java technology is both a programming language and a platform. • The Java programming language is a high-level object-oriented language that has a particular syntax and style. • A Java platform is a particular environment in which Java programming language applications run. The Java Programming Language Platforms There are four platforms of the Java programming language: • Java Platform, Standard Edition (Java SE) • Java Platform, Enterprise Edition (Java EE) • Java Platform, Micro Edition (Java ME) • JavaFX • All Java platforms consist of a Java Virtual Machine (VM) and an application programming interface (API). • The Java Virtual Machine is a program, for a particular hardware and software platform, that runs Java technology applications. • An API is a collection of software components that you can use to create other software components or applications. • Each Java platform provides a virtual machine and an API, and this allows applications written for that platform to run on any compatible system with all the advantages of the Java programming language: platform-independence, power, stability, ease-of-development, and security. • Java SE's API provides the core functionality of the Java programming language. – It defines everything from the basic types and objects of the Java programming language to high-level classes that are used for networking, security, database access, graphical user interface (GUI) development, and XML parsing. • The Java EE platform is built on top of the Java SE platform. The Java EE platform provides an API and runtime environment for developing and running large-scale, multi-tiered, scalable, reliable, and secure network applications.
• The Java ME platform provides an API and a small-footprint
virtual machine for running Java programming language applications on small devices, like mobile phones. • JavaFX is a platform for creating rich internet applications using a lightweight user-interface API. – JavaFX applications use hardware-accelerated graphics and media engines to take advantage of higher-performance clients and a modern look-and-feel as well as high-level APIs for connecting to networked data sources. – JavaFX applications may be clients of Java EE platform services. • The Java EE platform uses a distributed multitiered application model for enterprise applications. • Application logic is divided into components according to function, and the application components that make up a Java EE application are installed on various machines depending on the tier in the multitiered Java EE environment to which the application component belongs.
• Figure 1-1 shows two multitiered Java EE applications divided into
the tiers described in the following list. – Client-tier components run on the client machine.
– Web-tier components run on the Java EE server.
– Business-tier components run on the Java EE server.
– Enterprise information system (EIS)-tier software runs on the EIS
server. A First Simple Program
• For this example, the name of the source file should be
Example.java • In Java, all code must reside inside a class. • By convention, the name of the main class should match the name of the file that holds the program. Compiling the Program
• The javac compiler creates a file called
Example.class that contains the bytecode version of the program. • The Java bytecode is the intermediate representation of your program that contains instructions the Java Virtual Machine will execute. • The public keyword is an access modifier, which allows the programmer to control the visibility of class members. • When a class member is preceded by public, then that member may be accessed by code outside the class in which it is declared. • The keyword static allows main( ) to be called without having to instantiate a particular instance of the class. • This is necessary since main( ) is called by the Java Virtual Machine before any objects are made. • The keyword void simply tells the compiler that main( ) does not return a value. • String args[ ] declares a parameter named args, which is an array of instances of the class String. • Objects of type String store character strings. • In this case, args receives any command-line arguments present when the program is executed. • System is a class predefined by Java that is automatically included in your programs.