Wednesday, 2 January 2013

Basic Requirements to write a Java Program

Minimum Tools Required to Write a Program in Java


Java Compiler


A Java compiler is a compiler for the Java programming language.

Java Virtual Machine


A Java virtual machine (JVM) is a virtual machine that can execute Java bytecode.When you run a Java Program, the Computer is actually running the Java Virtual Machine. That JVM examines your byte codes, zero by zero, one by one, and carries out the instructions described in the bytecode. 


Java API


Java API refers to the Library files. Every java program, even the simplest one, calls on code in the Java API. 


An Editor


An editor is simply a window where we can write java program and save it in the disc. Notepad is one of the simple editors. There are a lot of editors available and some are specifically designed for writing java codes, which helps the programmer to format the code and also helps with few library files.  It is also known as Integrated Development Environment(IDE). 

Tuesday, 1 January 2013

Characteristics of Java

Java Characteristics and Features

Java is simple


Java was designed to be easy for the professional programmer to learn and use effectively.


Java is object-oriented


Java is true Object Oriented Language. Almost everything in Java is an object. All program code and data reside within objects and classes. 


Java is distributed


Java is designed as a distributed language for creating applications on networks. It has the ability to share both data and programs. Java applications can open and access remote objects on Internet easily as they can do in a local system. 


Java is Compiled and interpreted


Java combines both Compiled and Interpreted approaches thus making Java two stage-system. First, Java Compiler translates source code into what is known as bytecode instructions. Bytecodes are not machine instructions and therefore, in the second stage, Java Interpreter generates machine code that can be directly executed by the Machine. 


Java is robust


Java is robust language. It provides many safeguards to ensure reliable code. It has strict compile time and run time checking for data types. 


Java is secure


Security becomes an important issue for a language that is used for programming in Internet. Java Systems not only verify all memory access but also ensure that no viruses are communicated with an applet. 


Java is architecture-neutral


Operating system upgrades, processor upgrades, and changes in core system resources can all combine to make a program malfunction. The Java designers made several hard decisions in the Java language and the Java Virtual Machine in an attempt to alter this situation. Their goal was “write once; run anywhere, any time, forever.” To a great extent, this goal was accomplished.


Java is portable


Java ensures portability in two ways. First, Java Compiler generates bytecode instructions that can  e implemented on any machine. Secondly, the size of the prmitive data types are machine independent. 


Java is multithreaded


We can listen to an audio clip while scrolling a page and at the same time download an applet from a distant computer. This feature greatly improves the interactive performance of graphical applications. 


Java is dynamic


Java is capable for dynamically linking in new class libraries, methods, and objects. 

Introduction to Java



An Introduction to Java Programming.


Java is an object-oriented programming language with a built-in application programming interface (API) that can handle graphics and user interfaces and that can be used to create applications. Java is a high-level, third generation programming language, like C, FORTRAN, Perl, and many others. You 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. Compared to other programming languages, Java is most similar to C and C++. However, it is not mandatory to learn C or C++ to learn Java. 

One major difference is that Java does not have pointers. However, the biggest difference is that you must write object oriented code in Java. Procedural pieces of code can only be embedded in objects. In the following we assume that the reader has some familiarity with a programming language. In particular, some familiarity with the syntax of C/C++ is useful.

To actually execute Java programs, they developed Java interpreters that ran on various machines and under various operating systems. Thus, Java became a language that would execute on a number of systems and now has implementations for virtually all common computers and operating systems.The most string feature of Java is that it is platform-neutral language. Java is the first programming language that is not tied to any particular hardware or Operating System. Programs developed in Java can be executed anywhere on any system. 

Java is an Object Oriented Language. It enables us not only to organize our program code into logical units called objects but also to take advantage of encapsulation, inheritance, and polymorphism.