Consider the following incomplete class: public class SomeClass { public static final int VALUE1 = 30; public static int value2 = 10; private int value3 = 5; private double value4 = 3.14; public static void someMethod() { // implementation not shown } public void someOtherMethod() { // implementation not shown } } The method someMethod is defined as static. This means the method is an accessor method the method is accessible outside SomeClass the method is not accessible outside SomeClass the method is accessible without instantiating a SomeClass object the method is accessible only by using a previously instantiated SomeClass object
Added by Lilly B.
Step 1
- A static method belongs to the class rather than instances of the class (objects). This means that you can call a static method without creating an instance of the class. Show more…
Show all steps
Your feedback will help us improve your experience
James Kiss and 99 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Which Java keyword is used to refer to a class's hidden data fields? super static void this
John B.
Which keyword is required if you want a variable to be present, without instantiating an object from that variable’s class? A. private B. static C. int D. final E. abstract
Sarvesh S.
The method1 method in ClassB is an example of (A) method overloading. (B) method overriding. (C) polymorphism. (D) information hiding. (E) procedural abstraction.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD