Java - Static KeywordWhat is true about a non-static method in Java?AIt can be called without creating an object.BIt can access static variables directly.CIt belongs to the class, not instances.DIt cannot access instance variables.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand non-static method propertiesNon-static methods belong to object instances and can access both instance and static variables.Step 2: Evaluate optionsNon-static methods can access static variables directly, but cannot be called without an object.Final Answer:It can access static variables directly. -> Option BQuick Check:Non-static method access = static variables allowed [OK]Quick Trick: Non-static methods need objects but can access static variables [OK]Common Mistakes:Calling non-static methods without an objectThinking non-static methods can't access static variables
Master "Static Keyword" in Java9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Java Quizzes Methods and Code Reusability - Method declaration - Quiz 7medium Methods and Code Reusability - Why methods are needed - Quiz 3easy Packages and Access Control - Creating packages - Quiz 7medium Packages and Access Control - Why packages are used - Quiz 9hard Static Keyword - Static blocks - Quiz 4medium Strings and String Handling - StringBuilder and StringBuffer - Quiz 8hard Strings and String Handling - String vs StringBuilder - Quiz 9hard Wrapper Classes - Common wrapper methods - Quiz 3easy Wrapper Classes - Why wrapper classes are used - Quiz 11easy Wrapper Classes - Why wrapper classes are used - Quiz 13medium