A Poem in Java

Not sure if anyone knows this, but I have an interest in programming in addition to the writing. I studied Java in high school and decided to use it in a poem.


It is a silly poem that I made out of boredom. I’ll share the before and after.

/**

* A Poem in Java

*

* @author Naylene Rondon

* @version V1

*/

public class Poem

{

public static void main(String[]args)

{

System.out.println(“A Poem in Java”);

System.out.println(“It’s really a waste of time”);

System.out.println(“Something to do because I can”);

String [] rhymes = new String [5];

rhymes[0] = “cat”;

rhymes[1] = “hat”;

rhymes[2] = “bat”;

rhymes[3] = “sat”;

rhymes[4] = “fat”;

System.out.println(“I can easily print a list of rhymes”);


for(int i = rhymes.length- 1; i >= 0; i–)

{

System.out.println(rhymes[i]);

}


System.out.println(“Then do it all again”);

for(String a : rhymes)

{

System.out.println(a);

}


System.out.println(“I can make words from other words”);

String original = “Cryptogram”;

String one = original.substring(0,3);

String two = original.substring(4,6);

System.out.println(two + ” ” + one + ” is to have tears”);


System.out.println(“From afar looks so odd and uneven”);

System.out.println(“Yet once compiled is all become clear”);

System.out.println(“None of this really makes much sense”);

System.out.println(“Yet, it was fun to make”);

System.out.println(“A Poem in Java”);

}

}


 


After Compiled:


A Poem in Java

It’s really a waste of time

Something to do because I can

I can easily print a list of rhymes

fat

sat

bat

hat

cat

Then do it all again

cat

hat

bat

sat

fat

I can make words from other words

to Cry is to have tears

From afar looks so odd and uneven

Yet once compiled is all become clear

None of this really makes much sense

Yet, it was fun to make

A Poem in Java


 •  0 comments  •  flag
Share on Twitter
Published on May 01, 2016 13:48
No comments have been added yet.


More Than Scribbles

Naylene Rondon
A blog dedicated to the hard work of being a new and self-publishing author. The process of getting down your first book.
Follow Naylene Rondon's blog with rss.