/**
 *          StringExample; Example program to to demonstrate
 *          the simples aspect of Strings. This is covered in MUCH
 *          greater depth in basic IO and arrays sections.
 */
import java.awt.geom.*;                 // ignore at the moment

public class StringExample {
    public static void main(String args[]) {

	String first = "Hello";          //  declare and set two Strings 
	String second = "World";


	//       "Adding" Strings with + sign means ``concatinate together''
	//       so form one String. 

	String sentence = first + " " + second + " !";
	System.out.println(sentence);

	//      This also applies to "adding" non String objects,
	//      such as double, int, boolean etc, that are automatically
	//      converted to a String and then ``added'' 
	//
	//      This does NOT allow you to control the format of the
	//      number (more on this in the next section).

	double a = 13.345;
	int b = 45;
	boolean question = true;

	String output = "The values are a : " + a + " b is : " + b +
	    " and queston is : " + question;
	System.out.println(output);


	//     Same is true for ALMOST any other (well written!!!),
	//     Object. Point2D.Double is an Obeject to hold a 
	//     x/y coordinate pair, and when you ``add' to 
	//     a String, the Object ``knows how to convert itself''
	//     to a String. That's OOP is action!!!!

	Point2D.Double p = new Point2D.Double(23.0,45.9); // Create a point

	//       ``add'' the point to a String....  
	System.out.println("The point p is : " + p);
    }
}
