हिंदी

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

Advertisements
Advertisements

प्रश्न

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

विकल्प

  • Static method

  • Non static method

  • Wrapper class 

  • String method

MCQ
रिक्त स्थान भरें
Advertisements

उत्तर

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
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Class as the Basis of all Computation - Exercises [पृष्ठ ६५]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 2 Class as the Basis of all Computation
Exercises | Q 1. (xiii) | पृष्ठ ६५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×