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.


>> REGISTER NOW TO START POSTING


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
    Posts
    3
    Thanks
    0
    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
    Member
    Join Date
    Aug 2011
    Posts
    55
    Thanks
    5
    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
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: Problems with "/n"?

    Post the toString() method. That's probably where the problem is.

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 AM
  2. Replies: 7
    Last Post: August 13th, 2011, 01:22 AM
  3. havig problems with "this " refrence
    By anoop_mig25 in forum Java Theory & Questions
    Replies: 2
    Last Post: January 25th, 2011, 08:38 AM
  4. Java says:"Hello World". I say:"It works!"
    By Davidovic in forum Member Introductions
    Replies: 4
    Last Post: June 29th, 2010, 07:13 AM
  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, 08:35 AM