import javax.swing.JOptionPane;


public class PrintFun {

	public static void main(String[] args) {
		// This is a line comment.  Line comments start with "//".
		// Everything from the "//" to the end of the line is ignored
		// by the java compiler.
		
		/*
		 * This is a block comment.
		 * It extends over multiple lines.
		 * It begins with a /*
		 * and ends with a star-slash.
		 */

		System.out.println("This is how you print a string.");
		System.out.println(42);
		System.out.println(1.23);
		String s = "testing";
		int d = 42;
		double f = Math.PI;
		System.out.println(s + d);
		System.out.println(s + f);
		System.out.println(d + f);
		System.out.print("This has no newline.");
		System.out.println("See?");
		System.out.print("This has no newline.\n");
		System.out.println("See?");
		System.out.println("\\tab\tdouble-quote\"return\r");
		System.out.println("After return.");
		System.out.println("Kn\u00F6ller");
		System.out.printf("This is how you print a string %s, a decimal integer %d, and a floating-point number %f.\n",
				s, d, f);
		System.out.printf("This is how you get 10 decimal places: %.10f\n", f);
		System.out.printf("Rememember: %s %d %f\n", "another string", 123, Math.E);
		int a = 1;
		int b = 2;
		System.out.printf("%d + %d = %d\n", a, b, a + b);
		System.out.println(a + " + " + b + " = " + (a + b));
		System.out.printf("%e %f %g\n", Math.PI, Math.PI, Math.PI);
		
		String name = JOptionPane.showInputDialog("Please enter your name.");
		JOptionPane.showMessageDialog(null, String.format("Hello, %s!", name));
		
	}

}
