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
- private void greetings() // CHANGE TO PUBLIC?
- {
- Console.WriteLine("Hello!!");
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- 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
- TestClass.Cod = 3;
- Console.WriteLine(TestClass.Cod + "\n" + TestClass.greetings);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement