Computer Science, asked by shekharsawant042, 6 months ago

which of the following statement is true. a. Instance mehod can access instance variable and instance methods directly . b. instance method cannot access class variables and class methods directly . c. class methods can access class variables and class methods directly. d. class methods cannot access instance variable or instance methods directly_they must use an object reference​

Answers

Answered by jasha6608
5

Answer:

follow me for answers Aditya Jha sir

Answered by sourasghotekar123
0

Answer:

a, c are true

Explanation:

  1. Instance methods provide direct access to instance variables and methods.
  2. Class variables and class methods are readily accessible through instance methods.
  3. Class variables and class methods are immediately accessible via class methods.
  • I've learned from reading the Java documentation that a field declared with the "static" keyword is a class variable (or static field), and that a method defined with the "static" keyword is a static method (or class method). The class name itself serves as a reference for class variables and class methods.
  • To execute an instance method, we must first construct an object of the class in which it is defined. Instance methods are methods that need the creation of an object of their class in order to be called.
  • A class's instance variables are declared outside of any blocks, methods, or constructors.

#SPJ2

Similar questions