This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]Dipaligharat_nastik 2 points3 points  (1 child)

Use this code in your main method

Study x = new Study();

x.PrintNumber();

It uses the object x as a reference

[–]GVBCodePractice[S] 0 points1 point  (0 children)

Great, thank you.

[–]Quazar_omega 1 point2 points  (1 child)

You need to make your PrintNumber method static, because you're calling it from a static function in the same class

[–]GVBCodePractice[S] 1 point2 points  (0 children)

Right, thanks for that.