TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Static Nested Class Example With Static Method
Soumalya Das
Aug 05
2016
Code
1.1
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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