I have one class called Class1.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace static2
{
public class Automobile
{
public static int NumberOfWheels = 4;
public static int SizeOfGasTank
{
get
{
return 15;
}
}
public int compute(int a,int b)
{
int c = a*b;
return c ;
}
public static void Drive() { }
//public static event EventType RunOutOfGas;
// Other non-static fields and properties...
}
}
I am trying to use the compute method from Class1 under Program.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static2 ;
namespace static1
{
class Program
{
static void Main(string[] args)
{
Automobile.Drive();
int i = Automobile.NumberOfWheels;
Automobile car = new Automobile.compute(2,3);
Console.Write(car);
Console.WriteLine("sdfsdfds");
}
}
}
it says Automobile.compute(2,3) is a method but it is used like a type ?