コード例 #1
0
ファイル: Program.cs プロジェクト: sempf/CSharp2012
 public static void Main(string[] args)
 {
     Student student = new Student();
     student.InitStudent("Madeleine", "Cather");
     // Output the banner and name statically.
     Student.OutputBanner();
     Student.OutputName(student);
     Console.WriteLine();
     // Output the banner and name again using instance.
     student.OutputBannerAndName();
     // Wait for user to acknowledge.
     Console.WriteLine("Press Enter to terminate...");
     Console.Read();
 }
コード例 #2
0
ファイル: Program.cs プロジェクト: hbumadian/CSharpForDummies
 // OutputName - Output the student's name.
 public static void OutputName(Student student)
 {
   // Here the Student object is referenced explicitly.
   Console.WriteLine("Student's name is {0}", student.ToNameString());              
 }