Victory Road Archive

You are viewing an archive of Victory Road.

Victory Road closed on January 8, 2018. Thank you for making us a part of your lives since 2006! Please read this thread for details if you missed it.

Funny/Interesting Stuff → throw new Bomb("you");

Page 1 of 1

1. SpaceMan++ said on September 30, 2008, 06:14:10 PM (-07:00)

Zoroark
288 posts

Look at this funny Java code:

Main.java

Code:
/*
 * Main.java
 * Bomb - this is just a working joke code.
 */

package bomb;


/**
 * @author jirachifan
 */
public class Main { 
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws Bomb
	{
		try
		{
			throw new Bomb("you");
		}
		catch(Bomb the_Bomb)
		{
			the_Bomb.Explode();
		}
    }

}
Bomb.java
Code:
/*
 * Bomb.java
 */

package bomb;

/**
 *
 * @author jirachifan
 */
public class Bomb extends Exception
{
	private String Target;
	public Bomb(String theTarget)
	{
		System.out.println("The bomb was thrown to " + theTarget + ".\n");
		Target = theTarget;
	}
	public void Explode()
	{
		System.out.println("BOOM!!\n");
		if (Target.toString() == "you")
		{
			System.out.printf("%s are dead now.\n", Target);
		}
		else
		{
			System.out.printf("%s is dead now.\n", Target);
		}
	}
}
It outputs:
Code:
The bomb was thrown to you.

BOOM!!

you are dead now.

2. Yoshi648 said on October 1, 2008, 02:03:40 PM (-07:00)

Administrator
3,147 posts

LOL. I always thought of throwing and catching a ball, but a bomb works also.

3. KingOfKYA said on October 1, 2008, 07:41:15 PM (-07:00)

Volcarona
523 posts

Go

BOOM

4. Cat333Pokémon said on October 2, 2008, 04:26:12 PM (-07:00)

Administrator
10,307 posts

It reminds me of one of the Duel mini-games in...was it Mario Party 2? You had to pass a Bob-Omb around. If it exploded, you were out.

5. Yoshi648 said on October 2, 2008, 04:29:24 PM (-07:00)

Administrator
3,147 posts

Quote:
Originally Posted by cat333pokemon
It reminds me of one of the Duel mini-games in...was it Mario Party 2? You had to pass a Bob-Omb around. If it exploded, you were out.
That is one of my favorite mini games (and yes it is Mario Party 2).

Page 1 of 1

User List - Contact - Privacy Statement - Lycanroc.Net