Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Java (http://www.programmingforums.org/forum17.html)
-   -   First Java Program (http://www.programmingforums.org/showthread.php?t=9926)

duale2005 May 22nd, 2006 2:26 PM

First Java Program
 
Java is fully OOP, it doesn’t work without class.
Initial stage we will use Note pad

Example:
class First {
public static void main(String args[])
{
System.out.println("Welcome to Java");
}
}
You have to save the java with same name you are using the class.
e.g. First.Java
You have to enclose the name with double quotations “ ” why?
Because by default it takes the extension of three characters if you leave the Quotations it will save as First.Jav and its wrong

To run the java program you have to install JDK 1.3 (or later) Java Development Kit.

You have to save you file in C:\JDK\Bin\Fist.java

To run go to Dos
Type
C:\>CD JDK 
C:\JDK>CD Bin
C:\JDK\Bin> 
First you have to compile
You have to invoke your java compiler.
Javac is the Exe file.
C:\JDK\Bin>Javac First.Java 
If there is no error you will return to the directory:
First.Class is the byte-code.
C:\JDK\Bin>Java First 

Booooze May 22nd, 2006 2:41 PM

Welcome to the forums. I can see this is your first post.

Some pointers:
- Read the rules and FAQ guide.
- Put your code in <code> tags.

This is the Java section, but from what you posted it looks like you have a small tidbit or tutorial. PM a moderator and asked to have it moved to the tutorials section. It won't last long in the java section with new threads. :) Enjoy.

Jessehk May 22nd, 2006 2:55 PM

What the hell? :confused:

ReggaetonKing May 22nd, 2006 5:17 PM

That was the worst tutorial I've read in a while. I feel like writing one now...


All times are GMT -5. The time now is 1:18 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC