Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
why failure of finding instance of variable class?
i declare a variable in c# in microsoft visual studio, i declare a variable class,
public class product{...}
product p=new product();
p. // failure of finding that variable in instantiated
what is the problem, i have work experience in c and assembler, truth is i am more of a hardware and electric/electronic engineer than software engineer
1 Answer
- BenLv 710 years agoFavorite Answer
You might want to actually learn C# instead of typing C/C++ code into the C# file.
In C# (and Java), everything has to go into a class. You can't have code that exists outside a class and outside a method. To make code that runs when you execute the program, create a method
public static void Main(string[] args) { }
*inside* the product class and put the code in there.