Java - Static KeywordWhat is a key characteristic of a static variable in Java?AIt belongs to the class and is shared by all instances.BIt is unique to each object created from the class.CIt can only be accessed inside instance methods.DIt is automatically deleted when an object is destroyed.Check Answer
Step-by-Step SolutionSolution:Step 1: Understand static variable ownershipA static variable belongs to the class itself, not to any individual object.Step 2: Recognize sharing behaviorBecause it belongs to the class, all objects share the same static variable value.Final Answer:It belongs to the class and is shared by all instances. -> Option AQuick Check:Static variable = shared by all objects [OK]Quick Trick: Static means shared by class, not per object [OK]Common Mistakes:Thinking static variables are unique per objectConfusing static with instance variablesAssuming static variables are deleted with objects
Master "Static Keyword" in Java9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Java Quizzes Arrays - Common array operations - Quiz 11easy Command Line Arguments - Why command line arguments are used - Quiz 6medium Memory Management Basics - Object lifetime - Quiz 2easy Packages and Access Control - Why packages are used - Quiz 9hard Static Keyword - Static blocks - Quiz 2easy Strings and String Handling - String vs StringBuilder - Quiz 10hard Strings and String Handling - String immutability - Quiz 8hard Wrapper Classes - Autoboxing - Quiz 13medium Wrapper Classes - Autoboxing - Quiz 1easy Wrapper Classes - Unboxing - Quiz 14medium