17 May, 2008, 09:16:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: We Return!
 

Pages: [1] 2   Go Down
  Print  
Author Topic: Simple Java Tut (1)  (Read 7719 times)
0 Members and 2 Guests are viewing this topic.
Nepal
Chicks are supposed to be hot, not earth.

Games don't make people violent, lag does


Bronze Contribution
*
Hero Member

Karma: 2
Offline Offline

Gender: Male
Posts: 865
7908.36 Secksi Coins

View Inventory
Send Money to Bob_75

View Profile WWW
« on: 14 January, 2007, 11:33:03 PM »

Java is a programming language that is growing rapidly. It is basically based on C/C++. If you know C, java will be a breeze for you, literally. Java is like a second gereration of C/C++.

First of all, we need a program that  can compile Java programs that you write. I suggest getting JCreator. It is a free program that you can download from the JCreator website. Go to http://www.jcreator.com/download and download the JCreator Classic version (3rd program on the list), Java api documentation (last program on the list), and (if you don't already have the development kit) download the Java development kit. (for help on exactly how to download all these stuff, go to http://thecodingzone.com/index.php/topic,4203.0.html

Hopefully I don't have to tell you how to run the .exe file that you downloaded Wink

I suggest making a new folder somewhere in yor My Documents and keeping all your files and programs there.

Simple java program
       
     
Code:
        /* Simple Java program
           Author Bob_75
           Date created - Jan. 14, 2007
       */

// defining a class
      public class FunnyThings
          {
           public static void main (String[] args)
                 {
                 // display
                   System.out.println(" Some things that Bob thinks are funny");
                   System.out.println(" Clowns, Drug-adicts, Slaytanist");
                  }
         }
Those curly braces are necessary. If you forget to close the braces, it will give you an error message. If you misplace them, it will give you an error message as well.

So, if you compile the code above, a dos screen will pop up and give you...

Code:
Some things that Bob thinks are funny
Clowns, Drug-adicts, Slaytanist
Press any key to continue....

If you already couldn't tell, Java and JavaScript are very alike. Basically JavaScript is a programming language that was derived from Java. Java is a stand-alone programming language, but JavaScript isn't. (Yeah, like you already didn't know that  Undecided )

That's all for today guys. I'll try to post some more tutorials later.

~ Peace 
Logged

This resource was found useful by 4 out of 4 members. Rate it: [applaud] [smite]
United Kingdom
More metal than thee...

Low-Tech Code Monkey

Administrator

Silver Contribution
*
Conqueror

Karma: 72
Offline Offline

Gender: Female
Posts: 3687
294841.93 Secksi Coins

View Inventory
Send Money to Slaytanist

View Profile WWW
« Reply #1 on: 14 January, 2007, 11:41:08 PM »
It's as nice as a day can be... won't you come to the hanging with me?

Quote
Java is like a second gereration of C/C++.

Not at all. They're for completely different things.

Nice tutorial though : )
Logged


My standard sig is rated 15.
theworldneedsmore.com/puterphobia



I love you, Emz!
Nepal
Chicks are supposed to be hot, not earth.

Games don't make people violent, lag does


Bronze Contribution
*
Hero Member

Karma: 2
Offline Offline

Gender: Male
Posts: 865
7908.36 Secksi Coins

View Inventory
Send Money to Bob_75

View Profile WWW
« Reply #2 on: 14 January, 2007, 11:42:22 PM »

not really, they are very....veryy.....VERY....similar. peps at sun microsystems basically took C and made it better lol, dat is wat my teacher told me

ty btw Smiley
Logged

United Kingdom
More metal than thee...

Low-Tech Code Monkey

Administrator

Silver Contribution
*
Conqueror

Karma: 72
Offline Offline

Gender: Female
Posts: 3687
294841.93 Secksi Coins

View Inventory
Send Money to Slaytanist

View Profile WWW
« Reply #3 on: 15 January, 2007, 12:37:39 AM »
Pierced from below, souls of my treacherous past... betrayed by many now ornaments dripping above!

Your teacher is wrong : )

No probs though, it's a good tutorial.
Logged


My standard sig is rated 15.
theworldneedsmore.com/puterphobia



I love you, Emz!
Coding Team

Silver Contribution
*
Legendary Member

Karma: 19
Offline Offline

Posts: 1223
57168.48 Secksi Coins

View Inventory
Send Money to CodeMaster

View Profile WWW
« Reply #4 on: 15 January, 2007, 05:07:13 AM »

Your teacher is wrong : )

No probs though, it's a good tutorial.

Haha, slay is basically married to C Tongue


Does JCreator come with the JDK [java development kit]?

And you should write a tutorial for writing java applets, since it seems to be what it's best known for.
Logged

Bye.

I am no longer a part of this community.


Gold Contribution
*
Elite Member

Karma: 8
Offline Offline

Gender: Male
Posts: 193
729860.80 Secksi Coins

View Inventory
Send Money to pr0nslave

View Profile
« Reply #5 on: 17 January, 2007, 04:44:56 AM »

Your teacher is wrong : )

No probs though, it's a good tutorial.

Haha, slay is basically married to C Tongue

To say the least... Tongue

Anyhow, nice tutorial -- but, add more ;p I was getting back into the mood, "OOP" isn't that bad I guess... and then it ended. Sad
Logged

Do not PM me or anything. I am NOT a part of this community.
Coding Team

Silver Contribution
*
Legendary Member

Karma: 19
Offline Offline

Posts: 1223
57168.48 Secksi Coins

View Inventory
Send Money to CodeMaster

View Profile WWW
« Reply #6 on: 18 January, 2007, 05:20:17 AM »

Your teacher is wrong : )

No probs though, it's a good tutorial.

Haha, slay is basically married to C Tongue

To say the least... Tongue

Anyhow, nice tutorial -- but, add more ;p I was getting back into the mood, "OOP" isn't that bad I guess... and then it ended. Sad

IMO, OOP is a mood.  I have to get a feel for OOP again every time I decide to use it. 
Logged

Nepal
Chicks are supposed to be hot, not earth.

Games don't make people violent, lag does


Bronze Contribution
*
Hero Member

Karma: 2
Offline Offline

Gender: Male
Posts: 865
7908.36 Secksi Coins

View Inventory
Send Money to Bob_75

View Profile WWW
« Reply #7 on: 20 January, 2007, 05:55:14 PM »


Does JCreator come with the JDK [java development kit]?

And you should write a tutorial for writing java applets, since it seems to be what it's best known for.

no it doesn't, u have to download the jdk fromt the sun's website

and for the applet, lets learn the basic stuff first. good applets usually need more than one class defined and the "formating" is kinda wacky, u know...


Your teacher is wrong : )

No probs though, it's a good tutorial.

Haha, slay is basically married to C Tongue

To say the least... Tongue

Anyhow, nice tutorial -- but, add more ;p I was getting back into the mood, "OOP" isn't that bad I guess... and then it ended. Sad

IMO, OOP is a mood.  I have to get a feel for OOP again every time I decide to use it. 
AMEN  to dat C + Slaytanist = <3 thing.

i didn't write dat much cuz i didn't know peps here were interested in java. i am really happy to see all the feedbaks lol.
Logged

UnwantedSuperHeroUnited States
:/

<[(ˈ?ɹ:ə)]>

Ex-Staff

Gold Contribution
*
Addict

Karma: 3
Offline Offline

Gender: Female
Posts: 349
3273.76 Secksi Coins

View Inventory
Send Money to UnwantedSuperHero

View Profile
« Reply #8 on: 22 January, 2007, 02:13:06 AM »

If Java is anything like Javascript, then i would try to learn it...

Also, i've heard you can code Core JavaScript aslong as you import something called java.script :p That true?
Logged

URGENT: Having some trouble with FireFox or FireFox 2? Well, there's a brand new upgrade out that'll fix everything and more! Click Here To Download! Grin

//warning - above statement is bullshit
Nepal
Chicks are supposed to be hot, not earth.

Games don't make people violent, lag does


Bronze Contribution
*
Hero Member

Karma: 2
Offline Offline

Gender: Male
Posts: 865
7908.36 Secksi Coins

View Inventory
Send Money to Bob_75

View Profile WWW
« Reply #9 on: 23 January, 2007, 11:20:00 PM »

i don't know about the core javascript thingy, but java and js are very similar. as i said b4, java is a stand alone programming language, but javascript isn't. Java and JS are very similar. if u know java, or javascript, learning the other wud be easier. so, u can look into it, u'll understand a lot. i know some java and i can basically look at a js code and folo along.
Logged

"A programmer who shys away from elegant tricks will never be more than competent at best. Ego and a desire to attempt the impossible are traits of most great coders." - Slaytanist

"Music is love in search of a word" - S. Gabrielle

Code Tutor

Platinum Contribution
*
Hero Member

Karma: 23
Offline Offline

Gender: Male
Posts: 864
613901.20 Secksi Coins

View Inventory
Send Money to Eureka

View Profile WWW
« Reply #10 on: 20 February, 2007, 03:51:54 AM »

       
       /* Simple Java program
           Author Bob_75
           Date created - Jan. 14, 2007
       */

// defining a class
      public class FunnyThings
          {
           public static void main (string args [ ] )
                 {
                 // display
                   System.out.println(" Some things that Bob thinks are funny");
                   System.out.println(" Clowns, Drug-adicts, Slaytanist");
                  }
         }
Isn't it - public static void main (String[] args)?

String should be caps and that's the array.
Logged

Eureka's Signature Area: (Updated 01.24.2008)

Normally, I would have something as my signature, but I'm uninspired today. Sad

Eureka's Quotes Area: (Updated 12.19.2007)

Quote from: Slaytanist (a British codemonkey who hates structured programming)
"A programmer who shys away from elegant tricks will never be more than competent at best. Ego and a desire to attempt the impossible are traits of most great coders."

"The only way to be sure of the absence of bugs is to have an understanding of the project at the lowest levels. If you know all the rules the game is not hard."

"APL is a tool, not a language."

"Programs are fundamentally pieces of exectutable code; abstracting this notion is counterproductive. It can make a useless programmer useful but will not make an average programmer exceptional, hence the explosion in high-level programming is inherently due to economics and not innovation."
Nepal
Chicks are supposed to be hot, not earth.

Games don't make people violent, lag does


Bronze Contribution
*
Hero Member

Karma: 2
Offline Offline

Gender: Male
Posts: 865
7908.36 Secksi Coins

View Inventory
Send Money to Bob_75

View Profile WWW
« Reply #11 on: 28 February, 2007, 05:54:38 AM »

oh ty ken. string sud be String, but i don't think it matters if u pud String[] args or String args []. not sure. i'll double check and fix it.

fixed, and u were rite. Wink
Logged

"A programmer who shys away from elegant tricks will never be more than competent at best. Ego and a desire to attempt the impossible are traits of most great coders." - Slaytanist

"Music is love in search of a word" - S. Gabrielle

Code Tutor

Platinum Contribution
*
Hero Member

Karma: 23
Offline Offline

Gender: Male
Posts: 864
613901.20 Secksi Coins

View Inventory
Send Money to Eureka

View Profile WWW
« Reply #12 on: 01 March, 2007, 01:37:17 AM »

oh ty ken. string sud be String, but i don't think it matters if u pud String[] args or String args []. not sure. i'll double check and fix it.

fixed, and u were rite. Wink
I know I'm right because my teacher made the same mistake and I corrected him. Cheesy

BTW, you didn't capitalize String. Cheesy
Logged

Eureka's Signature Area: (Updated 01.24.2008)

Normally, I would have something as my signature, but I'm uninspired today. Sad

Eureka's Quotes Area: (Updated 12.19.2007)

Quote from: Slaytanist (a British codemonkey who hates structured programming)
"A programmer who shys away from elegant tricks will never be more than competent at best. Ego and a desire to attempt the impossible are traits of most great coders."

"The only way to be sure of the absence of bugs is to have an understanding of the project at the lowest levels. If you know all the rules the game is not hard."

"APL is a tool, not a language."

"Programs are fundamentally pieces of exectutable code; abstracting this notion is counterproductive. It can make a useless programmer useful but will not make an average programmer exceptional, hence the explosion in high-level programming is inherently due to economics and not innovation."
Nepal
Chicks are supposed to be hot, not earth.

Games don't make people violent, lag does


Bronze Contribution
*
Hero Member

Karma: 2
Offline Offline

Gender: Male
Posts: 865
7908.36 Secksi Coins

View Inventory
Send Money to Bob_75

View Profile WWW
« Reply #13 on: 01 March, 2007, 05:13:00 AM »

grrr....ty again, this dam book i have is messing my whole brain up. i am reading it everywhere lol, cuz i have a pdf format and in my usb drive, learning to program java for dummies. it is a gr8 book.
Logged

"A programmer who shys away from elegant tricks will never be more than competent at best. Ego and a desire to attempt the impossible are traits of most great coders." - Slaytanist

"Music is love in search of a word" - S. Gabrielle

Code Tutor

Platinum Contribution
*
Hero Member

Karma: 23
Offline Offline

Gender: Male
Posts: 864
613901.20 Secksi Coins

View Inventory
Send Money to Eureka

View Profile WWW
« Reply #14 on: 04 March, 2007, 08:24:28 AM »

Actually, I've been thinking about this topic quite a bit and I think I'll write a tutorial on this explaining the setup of JCreator a little more in-depth because other than that, I don't really see this as a helpful tutorial. Sad
Logged

Eureka's Signature Area: (Updated 01.24.2008)

Normally, I would have something as my signature, but I'm uninspired today. Sad

Eureka's Quotes Area: (Updated 12.19.2007)

Quote from: Slaytanist (a British codemonkey who hates structured programming)
"A programmer who shys away from elegant tricks will never be more than competent at best. Ego and a desire to attempt the impossible are traits of most great coders."

"The only way to be sure of the absence of bugs is to have an understanding of the project at the lowest levels. If you know all the rules the game is not hard."

"APL is a tool, not a language."

"Programs are fundamentally pieces of exectutable code; abstracting this notion is counterproductive. It can make a useless programmer useful but will not make an average programmer exceptional, hence the explosion in high-level programming is inherently due to economics and not innovation."
Pages: [1] 2   Go Up
  Print  
 
Jump to:  
Sponsored Links:

Data Recovery
Java Tutorials
Powered by MySQL
Powered by PHP
Powered by SMF 1.1.1 | SMF © 2005, Simple Machines LLC
TinyPortal v0.8.6 © Bloc
The rest copyright TCZ you pillocking twat!
Valid XHTML 1.0!
Valid CSS!
Places we'd like you to visit.