JAVA PROGRAMMING Java is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
1. Introduction to JAVA Java programming language was originally developed by Sun Micro - systems which was initiated by James Gosling and released in 1995 as core component of Sun Micro - systems' Java platform (Java 1.0 [J2SE]). The latest release of the Java Standard Edition is Java SE 8. With the advancement of Java and its widespread popularity, multiple configurations were built to suit various types of platforms. For example: J2EE for Enterprise Applications, J2ME for Mobile Applications. JAVA – As a Programming Language • The JAVA Programming Language is a high – level, object – oriented and general – purpose computer programming Language. • JAVA is similar to C++, but simplified to eliminate language features that cause common programming errors. • We can use JAVA to write computer applications that play games store data or do any of the thousands of other things computer software can do. • It is intended to let application developers “write once, run anywhere” (WORA), meaning that compiled JAVA code run on all platforms that support JAVA without the need for recompilation. JAVA – As a Computing Platform • A platform is the hardware or software environment in which a program runs. Some of the most popular platform is Microsoft Windows, Linux, Solaris OS and Mac OS. • Since JAVA has its own runtime environment (JRE) and API, it is called Platform. • There are lots of applications and websites that will not work unless we have JAVA installed, and more are created every day. • From laptops to data centers, game console to scientific supercomputers, cell phones to the internet, JAVA is everywhere. Where is JAVA used? According to Sun, 3 Billion devices run on JAVA. There are many devices here JAVA is currently used. Some of them are as follows: • Desktop Applications such as acrobat reader, media player, antivirus etc. • Web Application such as irctc.co.in, javapoint.com etc. • Enterprises Applications such as banking applications. • Mobile • Embedded System. • Smart Card • Robotics • Games etc. History of Java James Gosling initiated Java language project in June 1991 for use in one of his many set – top box projects. The language, initially called ‘Oak’ after an oak tree that stood outside Gosling's office, also went by the name ‘Green’ and ended up later being renamed as Java, from a list of random words. Sun released the first public implementation as Java 1.0 in 1995. It promised Write Once, Run Anywhere (WORA), providing no-cost run-times on popular platforms. On 13 November, 2006, Sun released much of Java as free and open source software under the terms of the GNU General Public License (GPL). On 8 May, 2007, Sun finished the process, making all of Java's core code free and open source, aside from a small portion of code to which Sun did not hold the copyright. Try It Option We have provided you with an option to compile and execute available code online. Just click the Try it button available at the top-right corner of the code window to compile and execute the available code. There are certain examples which cannot be executed online, so we have skipped those examples. public class MyFirstJavaProgram { public static void main(String []args) { System.out.println("Hello World"); } } There may be a case that you do not see the result of the compiled/executed code. In such case, you can re-try to compile and execute the code using execute button available in the compilation pop-up window. 2. JAVA Features Features of JAVA Programming Language are: • Simple • Secure • Portable • Object – Oriented • Platform Independent • Robust • Multithreaded • Architecture – Neutral • Interpreted • High Performance • Distributed • Interpreted • Dynamic Simple: JAVA is easy to write and readable and eye catching. JAVA has a concise, cohesive set of features that makes it easy to learn and use. Most of the concepts are draw 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 (.JVM). JAVA Programs can be run on any platform (Linux, Window, and 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). Platform Independent: Unlike other programming languages such as C, C++ etc which are compiled into platform specific machines. JAVA is guaranteed to be write – once, run – anywhere language. Robust: JAVA encourages error – free programming by being strictly typed and performing run – time checks. Multithreaded: JAVA provides integrated support for multithread programming. Architecture – Neutral: JAVA is not tied to a specific machine or operating system architecture. Machine Independent i.e. JAVA is independent of hardware. Interpreted: JAVA supports cross – platform code through the use of JAVA byte code. Byte code can be interpreted on any platform by JVM. High Performance: Byte codes are highly optimized. JVM can executed them much faster. Distributed: JAVA was designed with the distributed environment. JAVA can be transmitting, run over internet. Dynamic: JAVA Programs carry with them substantial amounts of run – time type information that is used to verify and resolve accesses to objects at run time. Interpreted: An interpreter is needed in order to run JAVA programs. The Programs are compiled into JAVA Virtual Machine code called byte code. The byte code is machine independent and is able to run on any machine that has a JAVA interpreter. With JAVA, the program need only be compiled once and the byte code generated by the JAVA compiler can run on any platform. |