I am a college student just starting out with java and I am working with pretty easy stuff here (I guess, lol), but im just trying to learn one bit at a time. I am just displaying my values in different ways and I can't seem to get my values to display one at time on new lines. I dont know why the \n isnt compiling. The part i am having trouble with has the "Not Working" tag in the code.
[highlight=Java]
//Trying to figure out how to use /n
public class Test
{
public static void main(String[] args)
{
int gold= 5;
int silver= 3;
int bronze= 1;
//Stacked titles
System.out.println(" gold\n silver\n bronze");
//Values stacked (not working)
System.out.print (gold\n silver\n bronze);
//Values side by side
System.out.println( gold + " " + silver + " " + bronze);
//Values added together
System.out.println(gold + silver + bronze);
}
}