How to Start Java Programming

Operating System Tips, Tricks and Hack which include Windows 10 and others, CentOS, Linux, MAC OS, iOS
Post Reply
User avatar
itslucky
Fun Addict
Fun Addict
Posts: 935
Joined: Jan 14, 2009
Location: UNITED KINGDOM

How to Start Java Programming

Post by itslucky » Apr 24, 2009 Views: 9791

My Dear, for java development, u didn't need any of the large compiler or the programs

* Java is just three steps

1. write a java program ( u can also write ur code in Notepad)

2. compile it

3. Run on any Machine

for the developers:

u need the Java JDK (Java Development Kit) u can download it from

https://java.sun.com/products/archive/j ... index.html

u can also write ur code in Notepad, but the IDEs alsways the best choice because they are very usefull ( to correct ur typing/syntax error )


so here is the link of one of the IDE (Netbeans)

https://www.netbeans.org/downloads/

*The IDE is not so important to be with you (but it is Best to be with you)*

Now u have all the tools, lets Dirty ur hands with the Java Coding :P

User avatar
itslucky
Fun Addict
Fun Addict
Posts: 935
Joined: Jan 14, 2009
Location: UNITED KINGDOM

Write ur FIRST JAVA PROGRAM

Post by itslucky » Apr 24, 2009

According to me (Lucky), in any of the programming language we must know about following three things

1. How to print info on Screen?

2. How to take input?

3. How to print the taken inputs?

so now lets start with the Step 1: (Print Info on Screen)

1. open the notepad

2. type/copy the following code

////////////////////////////////////


public class myprogram {

public static void main(String args[])
{
System.out.println("Hi...!!! Welcome to my First Program in Java...");
}

}

///////////////////////////////////






3. now save the code to the

>>> C:\Program Files\Java\jdk1.6.0_06\bin

(The place where your JDK is installed {above is the dafault location} )





NOTE:
in the above pic when i type the name of program, it is the same name as the name of my class in the code..

and i have type "" double quotes and in them i type "myprogram.java"

now save it.

4. Now lets Compile and run the code

Open Run from Start Menu (or Shortcut key "win+R")

and type

CMD

hit enter, and goto the following location

C:\Program Files\Java\jdk1.6.0_06\bin

by typing as the following picture

then compile and run the code





In the above pic

To compile the code:

we type

>> javac myprogram.java (hit Enter)

then execute the compiles program

>> java myprogram (hit enter)

////////////////////////////////
from the above, I think u people now print any text on the screen

just edit the

>>System.out.println("Hi...!!! Welcome to my First Program in Java...");

line and thats it...

User avatar
chandoo
Ultimate Contributor
Ultimate Contributor
Posts: 19019
Joined: Sep 08, 2007
Location: Lahore
Contact:

Post by chandoo » Apr 24, 2009

so you got a new forum. congrats

good start. all the best.

User avatar
itslucky
Fun Addict
Fun Addict
Posts: 935
Joined: Jan 14, 2009
Location: UNITED KINGDOM

Post by itslucky » Apr 24, 2009

Thanx!!! :D

sunny
Initiator
Initiator
Posts: 1325
Joined: Aug 28, 2008

Post by sunny » Apr 24, 2009

Great work..! It will help the needy in this field.... Keep going..!!!

ar
Ultimate Contributor
Ultimate Contributor
Posts: 6667
Joined: Feb 17, 2007
Location: Pakistan, Lahore
Contact:

Post by ar » Apr 25, 2009

Thanks for Sharing

editorawais
Ultimate Contributor
Ultimate Contributor
Posts: 3700
Joined: Nov 15, 2008
Location: Buzy!!!

Post by editorawais » Apr 25, 2009

gr8 work dude.thnx for sharing

User avatar
itslucky
Fun Addict
Fun Addict
Posts: 935
Joined: Jan 14, 2009
Location: UNITED KINGDOM

Post by itslucky » Apr 25, 2009

Thanku Thanku :D

User avatar
ujala
Ultimate Contributor
Ultimate Contributor
Posts: 18532
Joined: Jan 31, 2009
Location: Islamabad
Contact:

Post by ujala » Apr 26, 2009

now can i call u

SIR LUCK :)



Thanks 4 great sharing

User avatar
itslucky
Fun Addict
Fun Addict
Posts: 935
Joined: Jan 14, 2009
Location: UNITED KINGDOM

Post by itslucky » Apr 26, 2009

:D

But still when i look at ur POSTS, it seems that u r elder then me,
so just call me "Lucky" becoz "itsLucky" :)

its my pleasure that u call me that...


u welcome...

and if u have any query then please post it...

i'll be glad to assist u..!!! :)

Post Reply

Return to “Operating System Tricks”