Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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
Static Nested Class Example With Static Method
WhatsApp
Soumalya Das
Aug 05
2016
1.2
k
0
0
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.Threading.Tasks;
namespace
Consolepractice
{
class
Program
{
public
static
void
Main(
string
[] args)
{
Outer.Inner.msg();
//no need to create the instance of static nested class
Console.ReadKey();
}
}
class
Outer
{
static
int
data = 10;
public
static
class
Inner
{
public
static
void
msg()
{
Console.WriteLine(
"data is="
+data);
}
}
}
}
Static Nested Class
Static Method
Nested Class
Up Next
Static Nested Class Example With Static Method