C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
1
Reply
What is the use of "as" Keyword ?
Atulya Panda
13y
2.6k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
As operator allows you to perform conversions between compatible reference types. Consider the following example...using System;class Employee { public int a = 10; } class Manager : Employee { } class Program {static void Main(string[] args){Employee emp = new Employee();// emp1 would point to the same object as empEmployee emp1 = emp as Employee;Console.WriteLine(emp1.a);// emp2 would be nullvar emp2 = emp as Manager; } }
Ramakrishna
13y
0
How many keyword present in C# language ?
What is var keyword ?
Message