Calculator.cs
namespace ConsoleApp6.Math
{
public class Calculator
{
public int Add(int a,int b)
{
return a + b;
}
}
}
Program.cs
using ConsoleApp6.Math;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp6
{
class Program
{
static void Main(string[] args)
{
Person john = new Person();
john.FirstName = "John";
john.LastName = "Smith";
john.Introduce();
Calculator calculator = new Calculator();
var result = calculator.Add(1, 2);
System.Console.WriteLine(result);
}
}
}
Person.cs
using System;
namespace ConsoleApp6
{
public class Person
{
public string FirstName;
public string LastName;
public void Introduce()
{
Console.WriteLine("My name is:"+FirstName+" "+LastName);
}
}
}