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
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)
{
Console.Write("This is Line 1");
Console.Write("This is Line 2");
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;
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;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
}
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
}
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
}
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
int resultInt = PlusMethod(1, 2);
double resultDouble = PlusMethod(2.4, 4.4);
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
var animal = new Animal();
var cat = new Cat();
using System;
namespace TestFile
{
class Program
{
static void Main(string[] args)
{
var result = Calculator.Sum(5, 7);
Console.WriteLine("The sum of 5 and 7 is " + result);