English

Method which is a part of a class rather than an instance of the class is termed as ______.

Advertisements
Advertisements

Question

Method which is a part of a class rather than an instance of the class is termed as ______.

Options

  • Static method

  • Non static method

  • Wrapper class 

  • String method

MCQ
Fill in the Blanks
Advertisements

Solution

Method which is a part of a class rather than an instance of the class is termed as static method.

Explanation:

A method that is a part of a class rather than an instance (object) of the class is called a static method.

  • A static method belongs to the class itself, not to any individual object.
  • It can be called directly using the class name without creating an object.
  • Static methods can access only static data members directly.
  • In Java, the keyword static is used to declare a static method.
shaalaa.com
  Is there an error in this question or solution?
Chapter 2: Class as the Basis of all Computation - Exercises [Page 65]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 2 Class as the Basis of all Computation
Exercises | Q 1. (xiii) | Page 65
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×