Results 1 to 2 of 2
  1. #1
    hungrymouth is offline Member
    Join Date
    Sep 2013
    Rep Power

    Default Printing a new line

    Hi everyone, I am new to Java and I got the basics you know printing Hello World and all that good stuff. But I just added another line and it does not appear when I compile it. Only Hello World appears. What might be the problem?

    Java Code:
    public class MyFirstJavaProgram {
        public static void main(String []args)
    	System.out.println("Hello World. ");
    	System.out.print("How are you all today?");

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: Printing a new line

    Quote Originally Posted by hungrymouth View Post
    I just added another line and it does not appear when I compile it.
    I wouldn't expect it to. You need to learn the difference between compiling and executing Java code.

    Start here: Trail: Getting Started (The Java™ Tutorials)

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Printing 5 Strings per line
    By mafro in forum New To Java
    Replies: 14
    Last Post: 05-04-2012, 10:03 AM
  2. Printing indexOf line
    By clrgomes in forum New To Java
    Replies: 2
    Last Post: 03-06-2011, 08:30 AM
  3. Having trouble with printing a blank line.
    By Meta in forum New To Java
    Replies: 4
    Last Post: 05-11-2010, 10:54 PM
  4. Issue with printing line
    By Azndaddy in forum Advanced Java
    Replies: 1
    Last Post: 04-04-2008, 07:37 PM
  5. Printing command line arguments
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 09:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts