Head Resist

Web design, Programming, Development and SEO

Java – Programmimg Language

Sunday, December 11th, 2011

Java is an object oriented and structured programming language, designed by Sun Microsystems in the year 1991.Java is a third generation programming language. It has an in built application interface which has the ability to handle the graphics and user interfaces that creates the applets or applications.

The very advantage of java is its “portability”, the programmer can write the program and compile in the same kind of environment as it is written and after that it can be run anywhere.

Java relates to both C and C++, it uses the syntax of C and the object oriented concepts from c++ and this makes Java appealing. When a source code is given as the input, the output from java compiler is the “bytecode”. Bytecode contains set of instructions which will be executed by Java Virtual machine (JVM). In a more simple way, I can say JVM interprets the bytecode and this is the reason that java can be run anywhere. Applets are the programs which are embedded in to web page and can be executed where as the applications are directly executed by JVM.

It is not always possible to compile the complete program at the same time, so java uses just-in-time compiler to compile a set of bytecodes in real time for execution and the remaining codes will just be interpreted and thus makes the execution of Java program faster. The two main building blocks of java programming are the classes and objects. Objects are the instance of class and class is a template for creating objects.

Unlike in c/c++ you need not manually allocate/de allocate dynamic memory, java itself does this and also it has garbage collection for the unused objects. Java program handles the run time errors too. Java supports multithreaded programming.

To summarize Java is easy to use, write and to compile, it is robust, platform –independent, distributed, interpreted and secure.

Java Programming

Wednesday, March 24th, 2010

Java is a programming technology developed by Sun Microsystems. Java is an object-oriented language. Java can be used for web development.

Java is platform independent. The java code is compiled into a bytecode that can be run on a Java Virtual Machine(JVM). So Java code will run on any system that has a JVM installed in it. Java is robust, flexible and scalable. It can also be used to communicate with legacy systems.

Java provides a lot of classes or objects. Java Swings is a tool-kit that has a wide range of objects from text-boxes to menu bars to make website design easy.

Java programs consist of classes. Classes consist of methods. Java language can be used to develop object oriented applications.

Visit

http://learnjavatoday.blogspot.com

for more details.

The simplest form of a java program is as follows:

// Java program 1

public class Welcome1{

public static void main (String args[])

{

System.out.println ( “Welcom”);

}

}

In the above example;

// denotes that the statement is a comment and it not considered for programming.

The statement public class welcome1 is used to define the class. Java programs consist of classes defined like this.

The statement public static void main is used to define program building block. Every java program consist of a main function.

The statement System,out.println is used to produce the output. It gives instructions to the computer to print the String as an output.

Save the above program as Welcome1.java in the java Bin Directory.

Example C:javabin

The next step is to create the .class file by compiling the .java file.

In the dos prompt,

Type javac Welcome1.java and press enter.

It will produce a .class filee.

The final step is to run the class file. Type java Welcome1 to execute the .class file.

You will receive the desired output.