Whenever I try to call a method in the main it gives me the error
non static method can’t be reference from s static context
I tried creating objects in the main and send them as parameter to the method but it doesn’t work either.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
mainis a static method.public static void main(String[] args).From static method or block any other static method as well static instance’s are accessible. And if you ant to access non static method or instance you have to create object and access through the reference.