Java Programming 2: Introduction to Java Programming

Introduction to Java Programming

Wednesday, April 14, 2010

 



History


Java is a high-level object-oriented programming language developed by the Sun Microsystems. Though it is associated with the World Wide Web but it is older than the origin of Web. It was only developed keeping in mind the consumer electronics and communication equipments. It came into existence as a part of web application, web services and a platform independent programming language in the 1990s.


Earlier, C++ was widely used to write object oriented programming languages, however, it was not a platform independent and needed to be recompiled for each different CPUs. A team of Sun Microsystems including Patrick Naughton, Mike Sheridan in the guidance of James Goslings decided to develop an advanced programming language for the betterment of consumer electronic devices. They wanted to make it new software based on the power of networks that can run on different application areas, such as computers and electronic devices. In the year 1991 they make platform independent software and named it Oak. But later due to some patent conflicts, it was renamed as Java and in 1995 the Java 1.0 was officially released to the world.
Java is influenced by C, C++, Smalltalk and borrowed some advanced features from some other languages. The company promoted this software product with a slogan named “Write Once Run Anywhere” that means it can develop and run on any device equipped with Java Virtual Machine (JVM). This language is applicable in all kinds of operating systems including Linux, Windows, Solaris, and HP-UX etc.





Java technology


Since 1995, Java has changed our world . . . and our expectations..
Today, with technology such a part of our daily lives, we take it for granted that we can be connected and access applications and content anywhere, anytime. Because of Java, we expect digital devices to be smarter, more functional, and way more entertaining.
In the early 90s, extending the power of network computing to the activities of everyday life was a radical vision. In 1991, a small group of Sun engineers called the "Green Team" believed that the next wave in computing was the union of digital consumer devices and computers. Led by James Gosling, the team worked around the clock and created the programming language that would revolutionize our world – Java.
The Green Team demonstrated their new language with an interactive, handheld home-entertainment controller that was originally targeted at the digital cable television industry. Unfortunately, the concept was much too advanced for the them at the time. But it was just right for the Internet, which was just starting to take off. In 1995, the team announced that the Netscape Navigator Internet browser would incorporate Java technology.
Today, Java not only permeates the Internet, but also is the invisible force behind many of the applications and devises that power our day-to-day lives. From mobile phones to handheld devises, games and navigation systems to e-business solutions, Java is everywhere!


Java features
The Java Virtual Machine●Java Virtual Machine (JVM)–an imaginary machine that is implemented by emulating software on a real machine–provides the hardware platform specifications to which you compile all Java technology code●Bytecode–a special machine language that can be understood by the Java Virtual Machine (JVM)–independent of any particular computer hardware, so any computer with a Java interpreter can execute the compiled Java program.
Garbage collection thread –responsible for freeing any memory that can be freed. This happens automatically during the lifetime of the Java program.–programmer is freed from the burden of having to deallocate that memory themselves
Code security is attained in Java through the implementation of its Java Runtime Environment (JRE). ●JRE –runs code compiled for a JVM and performs class loading (through the class loader), code verification (through the bytecode verifier) and finally code execution
●Class Loader–responsible for loading all classes needed for the Java program–adds security by separating the namespaces for the classes of the local file system from those that are imported from network sources–After loading all the classes, the memory layout of the executable is then determined. This adds protection against unauthorized access to restricted areas of the code since the memory layout is determined during runtime
Bytecode verifier–tests the format of the code fragments and checks the code fragments for illegal code that can violate access rights to objects
Phases of java program

Phase Purpose Tasks
1
Planning
Prepare log sheets
Record estimates for time in each phase
Record planning time in the time recording log
2
Requirements
Study and understand the requirements in detail
Determine the exact formats for input and output, and any command line parameters.
Record requirements time in the time recording log
3
Design
Think about the algorithms you will use
Think about the program design
Record design time in the time recording log
4
Code
Implement the design
type in the code
Record coding time in the time recording log
5
Compile
Compile the program
Fix all defects found
Record compile time in the time recording log
6
Test
Develop test cases
Test the program
Debug defects
Fix all defects found
Record testing time in the time recording log
7
Performance
Count lines of code
Develop performance test cases
Execute and record performance
Record performance time in the time recording log
8
Postmortem
Complete the project plan summary form with actual time spent
Think about the experience, and write a brief report
Record postmortem time in the time recording log




Difference between Java Application and Java Applets


In simple terms, an applet runs under the control of a browser, whereas an application runs stand-alone, with the support of a virtual machine. As such, an applet is subjected to more stringent security restrictions in terms of file and network access, whereas an application can have free reign over these resources.


Applets are great for creating dynamic and interactive web applications, but the true power of Java lies in writing full blown applications. With the limitation of disk and network access, it would be difficult to write commercial applications (though through the user of server based file systems, not impossible). However, a Java application has full network and local file system access, and its potential is limited only by the creativity of its developers.
What makes a Java an Object Oriented Programming Language

0 comments: