Here is the code
class method
{
int counter = 0;
public static void main(String[] args)
{
System.out.println(counter);
}
}
It gave me this error.
Main.java:6: error: non-static variable counter cannot be referenced from a static context
System.out.println(counter);
^
How do I make it recognize the variables of the class?
Select the correct answer from above options
questions and answers, questions pdf, question bank, questions and answers pdf, mcq on pdf, questions and solutions, mcq Test , Interview questions, Questions for Interview, MCQ (Multiple Choice Questions),Core Questions, Core Hadoop MCQ,core interview questions for experienced