Showing posts with label Hello World. Show all posts
Showing posts with label Hello World. Show all posts

Hello World Pt2

| Posted in , , , | Posted on 7:28 PM

After one or two compilation errors I eventually got a clean build. I love the way /* comments look as opposed to //. It's an aesthetic, but you have to enjoy the simple things.


/*

* This is a simple demo displaying "Hello World".
*/

package helloworld;

/**
* @author Neil
*/

public class Main {

public static void main(String[] args) {
System.out.println("Hello World");

}

}

The author suggested pulling in an additional class that enables dialog boxes. This was done by "importing" it. I don't know how people remember these long class names. Maybe it comes with time. Sometimes the IDE will pop up suggestions. It suggested System.out.println but didn't do anything with JOptionPane.showMessageDialog.

/*
* This is a simple demo displaying "Hello World".
*/

package helloworld;

/*Pull in a class that enables a pop up msg box.*/
import javax.swing.JOptionPane;

/**
* @author Neil
*/
public class Main {

public static void main(String[] args) {
/*Output window.*/
JOptionPane.showMessageDialog(null, "Hello World!");

}

}

Yep. The dialog box popped up just like it should have. Huzzah!

Hello World

| Posted in , | Posted on 11:09 AM

And so it begins.

Nearly every programmer begins with the simple task of creating and executing a program to output a single line of text. "Hello World" has often been that line. It's been a long while since I've cracked open a text editor and even longer since firing up a compiler. The basics have escaped me and I've really forgotten how to craft something even so basic as a "Hello World". It's sad; I'm sad!

Tonight I'll be opening the book, launching my favorite IDE, and churning out some code.

Until then... Auf Wiedersehen.