Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Coba.cs
- // Namespace Declaration
- using System;
- // helper class
- class Coba
- {
- string text_ku;
- // Constructor
- public Coba(string input_text)
- {
- text_ku = input_text;
- }
- // Instance Method
- public void tampil()
- {
- Console.WriteLine("{0}", text_ku);
- }
- // Destructor
- ~Coba()
- {
- // Some resource cleanup routines
- }
- }
- // Program start class
- class Program
- {
- // Main begins program execution.
- public static void Main()
- {
- // Instance of Coba
- Coba contoh = new Coba("Hai, saya C#");
- // Call Output class' method
- contoh.tampil();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment