I\'m new in programming and I would like to know where did I go wrong in instantiating an object. Below is the code:
public class Testing{
private int Sa
Sample is not a class, it is just a method. You cannot create instances of it. You only run it -
int sample = Sample(3);
If you wish for sample to be a class, define it as a class.
In your case, the method is not static is so you cannot directly access it from the Static method Main. Make it static so you could access it. Or just create a new instance of Testing and use it -
Testing testing = new Testing();
int sample = testing.Sample(3);