Skip to content

Instantly share code, notes, and snippets.

View nanwang2016's full-sized avatar
🏠
Working from home

Nan W nanwang2016

🏠
Working from home
View GitHub Profile
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
}
using System;
using System.IO;
namespace TestFile
{
class Program
{
//The text file's path is stored in 'filename'
static string filename = @"C:\Users\Nan\source\repos\Example.txt";
using System.IO;
namespace TestFile
{
class Program
{
//The text file's path is stored in 'filename'
static string filename = @"C:\Users\Nan\source\repos\Example.txt";
static void Main(string[] args)
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
Console.Write("This is Line 1");
Console.Write("This is Line 2");
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
//Only Defaul Constructor with parameters is valid, as Private Constructor is not allowed to create an instance.
Student UniStudent = new Student("Jack", "007");
}
}
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
//Both Static and Default constructors will invoke for first instance
Student UniStudent = new Student();
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
Student UniStudent = new Student("Jack", "007");
Student NewUniStudent = new Student(UniStudent);
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
Student UniStudent = new Student("Jack", "007");
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
Student UniStudent = new Student();
UniStudent.Name = "Jack";
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
Student UniStudent = new Student();