Victory Road  

Go Back   Victory Road > General > General Chat > Funny/Interesting Stuff
FAQ Community Today's Posts Search

Notices

 
 
Search this Thread
  #1  
Old September 30, 2008, 05:14:10 PM
SpaceMan++'s Avatar
SpaceMan++ SpaceMan++ is offline
Zoroark
 
Join Date: Aug 2008
Location: BC
Posts: 288
Default throw new Bomb("you");

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  
Old October 1, 2008, 01:03:40 PM
Yoshi648's Avatar
Yoshi648 Yoshi648 is offline
Administrator

 
Join Date: Nov 2006
Location: Yoshi's Island
Posts: 3,147
Default Re: throw new Bomb("you");

LOL. I always thought of throwing and catching a ball, but a bomb works also.
  #3  
Old October 1, 2008, 06:41:15 PM
KingOfKYA's Avatar
KingOfKYA KingOfKYA is offline
Volcarona
 
Join Date: Sep 2008
Location: On The PC
Posts: 523
Default Re: throw new Bomb("you");

Go

BOOM
  #4  
Old October 2, 2008, 03:26:12 PM
Cat333Pokémon's Avatar
Cat333Pokémon Cat333Pokémon is offline
Administrator

 
Join Date: Nov 2006
Location: Nevada
Posts: 10,303
Default Re: throw new Bomb("you");

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  
Old October 2, 2008, 03:29:24 PM
Yoshi648's Avatar
Yoshi648 Yoshi648 is offline
Administrator

 
Join Date: Nov 2006
Location: Yoshi's Island
Posts: 3,147
Default Re: throw new Bomb("you");

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).
 

Forum Jump


All times are GMT -8.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Victory Road ©2006 - 2024, Scott Cat333Pokémon Cheney
Theme by A'bom and Cat333Pokémon