- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use WriteLine() method of Console class in C#?
WriteLine() is a method of the Console class defined in the System namespace
This statement causes the message "Welcome!" to be displayed on the screen as shown below −
Example
using System; namespace Demo { class Test { static void Main(string[] args) { Console.WriteLine("Welcome!"); Console.ReadKey(); } } }
Output
Welcome!
To display a char array using the Console.WriteLine.
Example
using System; namespace Demo { class Test { static void Main(string[] args) { char[] arr = new char[] { 'W', 'e'}; Console.WriteLine(arr); Console.ReadKey(); } } }
Output
We
Advertisements