Results 1 to 6 of 6

Thread: What is difference between write() and writeline()?

  1. #1
    Join Date
    Dec 2009
    Posts
    23

    What is difference between write() and writeline()?

    I am new(beginner) in this vast programming language world. Right now i am learning the programming language like C sharp, C++, Java and SQL. This days, i am practicing programs in C sharp using Microsoft .Net software. I have query regarding the c sharp programming that what is difference between Console.Write() and Console.Writeline() function? Please help me.

  2. #2
    Join Date
    Jan 2008
    Posts
    1,521

    Re: What is difference between write() and writeline()?

    This really confusion for those who are beginner/new to programming world. I would say that the "Write()" is function that writes the data to a sequential file. And the data written with write() function is usually read from a file with Input. Whereas, when WriteLine() function is use to insert a newline character (that is, a carriage return/line feed, or Chr(13) + Chr(10)), once the final character is written in the Output to the file. Always writing to a file with the Write() or WriteLine() function requires append access from the FileIOPermissionAccess enumeration.

  3. #3
    Join Date
    Feb 2008
    Posts
    1,852

    Re: What is difference between write() and writeline()?

    Firstly would say that there is 19 overloads on .WriteLine() function and only 18 on .Write() function. Always note that the overloaded method will have the same name, but it will always have different parameters. The overload can be either with different type's of parameters, different number's of parameters, or maybe both of them. Hope you will be able to understand write and writeline functions.

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: What is difference between write() and writeline()?

    Actually, both the write and writeline function are similar, but differs also that much only. The Write() function needs the system namespace to be included at the starting of program to get the fully qualified name. Also note that Write() function will not append any newline at the end of the Console, whereas writeline function does. Whenever you call WriteLine() function with no parameters, it writes a newline only, but this not allow in write() function.

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: What is difference between write() and writeline()?

    According to me, the write and writeline functions differs a lot from each other. They both are used for different purpose and reasons, and the action taken by them are also different. The write() method or function is used to print the output and at end of it the pointer/cursor will be on same line and not next line, whereas when we use the writeline() method or function after printing the mentioned data, it will go to the next line (the cursor/pointer will goto nextline).

  6. #6
    Join Date
    Nov 2005
    Posts
    1,323

    Re: What is difference between write() and writeline()?

    The write and writeline are the methods which are located inside the console class in C sharp. This both method are used for writing the data/information on the output screen, but they both work in different method. The write method is used when we don't know what we require to output in advance. The writeline method is used when want to write several values on a single line to the Console. One more difference is that write method will not newline. but the writeline method will go to newline at the end. Hope your problem will be fix.

Similar Threads

  1. Media is write protected error cannot write to disk
    By Bracken in forum Operating Systems
    Replies: 14
    Last Post: 22-08-2011, 08:58 AM
  2. Getting Writeline error in c#
    By Maal-Gaadi in forum Education Career and Job Discussions
    Replies: 6
    Last Post: 27-04-2011, 10:37 PM
  3. Console.WriteLine for dot net?
    By Shashikant in forum Software Development
    Replies: 4
    Last Post: 07-02-2009, 09:26 PM
  4. difference between 'Enable write cache ' & 'Enable advanced'
    By BlackSunReyes in forum Windows Vista Performance
    Replies: 2
    Last Post: 22-04-2008, 08:14 AM
  5. Replies: 0
    Last Post: 16-09-2007, 09:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,718,205,906.28130 seconds with 16 queries