Sunday, 2 October 2011

Java Language Basics

This article is the second in a series teaching the Java programming language with an eye towards its application to Web design and development. Specifically, the goal of this series is to teach you all you need to know to create dynamic Web sites using JavaServer Pages (JSP) and Java Servlets

  • Java is a powerful, cross-platform, object-oriented programming language.
  • It is suitable for writing anything from a distributed application that runs on a corporate network to a database-driven Web site to host your personal photo gallery.
  • To make it easier to learn, the Java language was designed to resemble some of the most popular programming languages in use today, most notably C/C++

Here is the listing for the program I helped you create in the previous article:


1 /**

2 * Hello.java

3 * A simple Java program

4 */

5 class Hello {

6 public static void main(String[] args) {

7 // Print a couple of one-line messages

8 System.out.println("Hello, World!");

9 System.out.println("This is a test.");

10 }

11 }





This is an exceedingly simple program, as Java programs go, and I’m sure you don’t need me to tell you that it’s quite useless. What good is a program that prints out the same two lines every time you run it? At the very least, a program should perform some kind of useful calculation, right?

REFERENCE BY:/www.sitepoint.com

No comments:

Post a Comment