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
Displaying Date Using Class And Objects In C#
Vijayaragavan S
Aug 11
2016
Code
1.1
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
using
System;
class
Program
{
static
void
Main()
{
// Creating an object for class DateDemo
DateDemo s1 =
new
DateDemo();
//Using object call the Member function
s1.DisplayDate();
}
}
//class declaration
class
DateDemo
{
//Member function Definition for DisplayDate
public
void
DisplayDate()
{
DateTime dt;
dt = DateTime.Today;
Console.WriteLine(dt.ToString());
Console.ReadKey();
}
}
Class
Objects
Display Date
C#