

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Different ways to start a Task in C#
To start a task in C#, follow any of the below given ways.
Use a delegate to start a task.
Task t = new Task(delegate { PrintMessage(); }); t.Start();
Use Task Factory to start a task.
Task.Factory.StartNew(() => {Console.WriteLine("Welcome!"); });
You can also use Lambda.
Task t = new Task( () => PrintMessage() ); t.Start();
- Related Questions & Answers
- How to start the specific task of the task scheduler using PowerShell?
- How to automatically start and stop an Async task in Kotlin?
- Different ways to overload a method in Java
- Different ways to clear a list in Python
- Different ways to create Objects in Java
- Different ways to concatenate Strings in Java
- Different Ways to Add Parentheses in C++
- How to create a Scheduled task with a task scheduler using PowerShell?
- Different ways of Reading a file in C#
- Extending a list in Python (5 different ways)
- PHP program different ways to generate a random string
- Different ways to change a character into uppercase in javascript?
- Three Different ways to calculate factorial in C#
- Different ways to print exception messages in Java
- 5 different ways to create objects in Java
Advertisements