Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Problems with "/n"?

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Thanked 0 Times in 0 Posts

    Default Problems with "/n"?

    I am writing a toString() Method to print out the results that I got from my program and since the Method return type is a String I cannot use System.out.print. So, I am using "/n" but for some reason each time I put a "/n" a line of code that has already been displayed with a System.out.print gets deleted? Does anyone know why? My program has multiple parts so I am hesitant to post it but I will if anyone needs it. I'm new here so if I made any errors I'm sorry

  2. #2
    Join Date
    Aug 2011
    Thanked 3 Times in 3 Posts

    Default Re: Problems with "/n"?

    The new line character is \n not /n That would be your problem. You could use the String.format method also.

  3. #3
    Registered Users javapenguin's Avatar
    Join Date
    May 2010
    North Central Illinois
    My Mood
    Thanked 112 Times in 110 Posts

    Default Re: Problems with "/n"?

    Post the toString() method. That's probably where the problem is.
    Please mark solved threads as "Solved" by going to threads and clicking "Mark Solved"
    Using code tags

    How To ask questions the smart way
    Java Tutorials
    Java API
    Save Our Snips
    Hit THANKS to thank a person. Hit REP+ to increase reputation (or decrease it). Cannot give to same person for a while.
    Shooting Park Road Baptist Church Site

Similar Threads

  1. Problems Making a "POST" to a Socket
    By haroldjclements in forum Java Networking
    Replies: 0
    Last Post: October 11th, 2011, 05:28
  2. Replies: 7
    Last Post: August 13th, 2011, 01:22
  3. havig problems with "this " refrence
    By anoop_mig25 in forum Java Theory & Questions
    Replies: 2
    Last Post: January 25th, 2011, 07:38
  4. Java says:"Hello World". I say:"It works!"
    By Davidovic in forum Member Introductions
    Replies: 4
    Last Post: June 29th, 2010, 07:13
  5. "java.lang.NoSuchMethodError: main" and "fatal exception occured."
    By joachim89 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 10th, 2010, 07:35