Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialDaniel Hildreth
16,170 PointsDifference between the Write methods
I learned the basics of C# recently from SoloLearn from the app I downloaded to my phone. In the courses, they were using:
Console.WriteLine("Enter how many minutes you exercised:");
Rather than using what Treehouse is doing here:
Console.Write("Enter how many minutes you exercised:");
Is there a difference between how these two methods are written, and what they'll return? Also, can a Console.ReadLine(); have parameters inside the parenthesis, and if so, what would they be used for (an example of it please)?
1 Answer
Steven Parker
231,210 PointsConsole.WriteLine writes a complete line, the next write will appear below it.
But Console.Write writes only the argument without going to the next line. The next write will go beside it.
And Console.ReadLine does not take any arguments.
Click on any of the links above for the official documentation.