How do I insert Java code into an HTML based website?

Zach

New member
This is the code that I wish to insert (just a sample), but I can't get it to do what I want it to do. All i want to show up is the output, but honestly I can't get anything to work because i'm dumb.

CODE:

import java.util.Scanner;

public class Slaughter
{

public static void main (String args [])
{
String input;
Scanner scan = new Scanner (System.in);
System.out.print("Your journey starts here. Through the eyes of the Tralfamadorians your actions are already decided,\n" +
"your fate predetermined - but time as you know it is linear; there is a beginning, a middle, and an end."
+ "\nTo commence your journey, type your first name: \n");
String name = scan.next();

System.out.print("Hello " + name + "-\nThere is a path you have yet to walk, determined by your birth year\n" +
"Enter the year in which you were born:\n");
int yearBorn = scan.nextInt();

if (yearBorn == 1993 || yearBorn%100 == 93)
{
System.out.print ("You're dead to me");
}
else if (yearBorn == 1994 || yearBorn%100 == 94)
{
System.out.print ("You have survived the Holocaust");
}
else
{
System.out.print("Stop lying");
}



}

}
 
Back
Top