Java anyone?

Category: Tutorials — Author: GerDoyle on Nov 16 with 21 comments

Hey guys.. I’ve been learning Java in College.. I think it’s a pretty cool language.. I am going to post up a few lessons / tutorials on Anto’s blog (If he doesn’t object lol)It will help me memorize along with maybe teaching you great readers :) :P

To start off with I’m going to go through the very basics (as thats as far as I know) :P but you need to take baby steps before you can leap….

Also before I start, or before you start I should stay, you should have an up-to-date JDK and a program such as BlueJ or Eclipse.. I’d prefer Eclipse as it’s easier to use. You can also just use Note pad and run the Java Program from Command Line (Which I will show how to do later on.

Ok lets start,

//Program that will print out the message "Hello World!"
//This is the most simplest program there is out there.

public class example {

 public static void main(String[] args) {

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

 }

}

Ok. In any program where ever you see the forward slashes “//” This means the compiler will not read this line. This is called a comment.
It’s important to use comments, in case you forget what you are doing..

You should memorize

public class example {

 public static void main(String[] args) {

This is used in any program, besides “example” as this changes according to what ever name you make it.
Notice the curly braces { { these are important and tell the compiler where the program starts and ends.
The compiler holds no prisoners and will not work if you have made any little mistake, this includes your curly braces and more which we’ll get to soon enough.

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

This uses the System function to print out a sentence or word or character or number or whatever..
Notice the capital S with System, you must use a capital, no matter where or when you use this line of code.
The semi-colon tells the compiler that that is the end of that line of code.
You must use your semi-colons where needed, if not your compiler will not run the program.

The writing between the inverted quotations and brackets is what’s going to be printed out to the screen.

You must use the inverted quotations and the brackets, these are all basic rules of Java.

the end curly braces denotes the end of the program and class.

}
}

Some of this might seem like “wtf” but it’s ok. You should keep trying this over and over again. I’ll be adding more lessons as time goes on, I should get one in tomorow.

Best way to learn all this gibberish is practice, practice and more practice!

number of view: 47
Comments
  • I think my 3 languages are all I can handle at the time. Plus trying to understand what the hell Eamonn is saying give me a headache. xd!

    I will take my java via Starbucks .

  • “Plus trying to understand what the hell Eamonn is saying give me a headache. xd!”

    I take it you mean Ger Doyle ? :P…

  • You have the advantage.

    Is Ger Doyle the same as Eamonn?

  • No.. lol.. Eamonn is Eamonn, Ger Doyle is Me.. :P

    I live down the South of Ireland, Eamonn lives at the North of Ireland. :D :D

  • Then no…. There was just a misunderstanding. However, you do look a tad like Eamonn. Is that good? :7

    This was fun! You made my day!!!

  • This guy is a keeper. I like.

  • Continuez à sourire !

  • Apparently the blog owner is MIA on the subject.

    Hello…. it is called a discussion. (Or maybe not. _)

  • I am lost.. It is a discussion, but, what are we discussing? And the topic of the discussion should be Java, as thats what you are supposed to be discussing.

  • If you are lost… apply at the lost and found. : )

    You just answered your own question. Yes the topic of discussion was indeed Java….. I was doing that, responding to the topic, until you questioned me. I then responded to you…

    Do try to keep up.

  • When I said “what are we discussing?” I was implying that you raved on about something completely different to Java. Do keep up. You responded to the comment perfectly, but after that was nothing at all to do with Java or anywhere related.

    Please keep up.
    Don’t mess with me, I don’t mess back.

  • Ouch!.. you bite. I like.

    What did I rave on about? I only answered to you after my fisrt comment to this post. If I raved… it was only in response to your comment to me.

    Well if you don’t mess back.. .why are you messing with me? Feel threatened? A little sexual tension? ;)

    Donnez-moi votre meilleur coup

    This is all in fun.

  • Je ne veux pas perdre mon temps avec mon meilleur coup.

    :)

  • Well it was your time and your shot. Waste not want not.

    Son été une grande =]

  • Now now. Play nice :P. Zipo im afraid its come the time to tell me/us whether your a male or female please, im sick of not having anything to write, in a sentence or to change the sentence because it refers to a boy or a girl.

    So please tell?

    As goes for the java, its a headache of a language, so imma pass on it, i know some java from having to fix scripts etc, what things do, but i dont really know about it, and i have no need to learn it, but im sure some people will want to learn.

  • We were playing nice! We were sharing. It was the best fun I have had in ages! I like GerDoyle.

    You need not make any exceptions for me. It is all-good here. :]

    Speaking of Java, and we were right? :wink: Every time I go on Daily Booth I get a virus alert. It has something to do with JavaScript. My Panda software neutralizes it immediately, but if I continue, it continues to flash a virus warning. I then run Adware SE just to remove any crap and it removes 4 cookies and it states it is a Java script file. Any ideas

  • :P

    On the off topic; you still didn’t answer Anto’s question :P

    Anyways, regarding your virus pop up, I wouldn’t worry about it, some virus software classes cookies etc as viruses.. When I do a system scan, I get abou 9 viruses about cookies.. nothing major..

  • :7

    Yah, but that little panda is annoying. I never had that warning before and I go on DB everyday. Curious as to what has found its way into my system. It had to have come from someone’s DB site right?

    Thanks for the help and if I don’t get to talk to you again soon… have a great weekend. : ) I am out the door for a little R & R!

  • I am back from a little R & R! :p

    Sault!

Leave a Comment