Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace test //c# in console
- {
- class TestClass
- {
- //members
- private int mCod;
- //properties
- public int Cod
- {
- get{
- return mCod;
- }
- set{
- mCod = value;
- }
- }
- //methods
- public void greetings()
- {
- Console.WriteLine("Hello!");
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- TestClass testC = new TestClass();
- void functest() //U can't declare with privacy and outside Main
- {
- Console.WriteLine("main func test");
- }
- bool i = true;
- if(i)
- Console.WriteLine("Hello World");
- functest();
- //using methods and properties of an internal class
- testC.Cod = 3;
- Console.WriteLine(testC.Cod + "\n");
- testC.greetings;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement