Learning Java Through Poetry

After reading so many informative posts this morning (strokes, Sudoku, knitting, computer animation, shorthand, and many more), I thought I’d write my own. I’ll start with a poem:

Roses are red
Violets are blue
Java is awesome
And so are you!

I learnt Java through Kathy Sierra’s Head First Java:

The reason why I loved it so much was because of the poetry scattered throughout:

FullSizeRender

And another one:

FullSizeRender(1)

Of course, I never realized this at the time. They were mere snippets of the book that really resonated with me (Wow, look at all this poetry, it is so cool, awesomeness). I would write all my own verses to match the ones I’d read.

So here’s a quick tutorial on a first Java program.

The following steps are how to get started with coding.

Install Java on any computer. And then follow the steps:

1. Create and save MyFirstApp.java (included below). For beginner purposes this can be done in a notepad and not an IDE. In fact, we never had the luxury of IDEs when I studied “so long ago”. In the days before Google.

2. Compile to create a class file (MyFirstApp.class) (google it if you need details)
javac MyFirstApp.java

3. Run the app from the console

And here is how a sample .java file looks like:

public class MyFirstApp {

public static void main(String[] args) {
System.out.println(“I Rule!”);
System.out.println(“The World”);
}
}

It’s been suggested I never go into teaching, so I’ll write poetry instead:

Roses are red
Violets are blue
I love coding
How about you?

https://dailypost.wordpress.com/dp_prompt/daily-prompt-2/

14 thoughts on “Learning Java Through Poetry

    1. Hi, thank you so much for the award! I am no accepting awards, but do appreciate the nomination, and will check out your post! Thank you for reading and enjoying my post, I’ve been in the mood to write a bit more than poetry lately, hoping the readers won’t mind too much LOL πŸ™‚

      Liked by 1 person

      1. I hope you will find useful my blog too! Well, I too carry a sole purpose with my blog.. is to educate, help and motivate everyone being a better person! I am sure you will love it…

        There is a new post called “@BeingBettr Asks” .. I would love to see your thought on that… will be waiting!! πŸ™‚

        Be Bettr, Stay Bettr!
        Swetank. πŸ˜€

        Liked by 1 person

  1. Roses are red,
    violets are sleek,
    your post made my day
    no, make that my week!

    I’ll never be an actual poet, but the fact that my silly little poems made a difference for someone learning Java makes me happier than you can imagine.
    Thank-you.
    — Kathy Sierra (Katrina Geringer)

    Liked by 1 person

    1. Wow, Kathy, you are my hero I have worked through all your books (including scjp manuals for Java 5 and 6), was very sad when you stopped your blog. Amazing to be in contact with you! And I Did take up your challenge to write my own (is-a relationship):

      Roses are red
      Violets are toys
      A boy is a person
      But not all people are boys!

      Thank you for stopping by, great to meet you, glad you have seen my post!

      Like

Leave a comment