Define Accessor method

Accessor method: A technique specifically designed to offer access to a private attribute of a class. By convention, we name accessors with a get prefix followed by the name of the attribute being accessed. For example, the accessor for an attribute named speed would be ‘getSpeed’. By creating an attribute private, we save objects of other classes from varying its value other than via a mutator method. The Accessors are employed both to grant safe access to the value of a private attribute and to save attributes from inspection by the objects of other classes. The later goal is attained by selecting a suitable visibility for the accessor.

   Related Questions in Programming Languages

  • Q : What is Search path Search path : It is

    Search path: It is a list of folders (that is, directories) to be searched - for a program or class, for example.

  • Q : Explain Magic number Magic number : It

    Magic number: It is a constant value with significance within a specific context. For example, the value 12 could mean numerous different things - the number of hrs you have worked today, the number of dollars you are payable by a friend, and so forth

  • Q : What is Low level programming languages

    Low level programming languages: It is frequently termed as `assembly languages’; these give little more than the fundamental instruction set of a particular Central Processing Unit. Therefore programs written in low level programming languages

  • Q : What is message queue Describe the

    Describe the message queue?

  • Q : Overloading and overriding in the

    Illustrate the difference between overloading and overriding in the programming language?

  • Q : Define the term Condition Define the

    Define the term Condition: It is a Boolean expression which controls a conditional statement or loop.

  • Q : Microsoft Access I have attached a

    I have attached a database and a PDF with 5 questions. I need the 5 questions answered with 5 queries in the database. Question 3 needs a crosstab query. All the questions require the proper join.

  • Q : Explain myriad of computer systems of

    Explain myriad of computer systems of your target users?

  • Q : Explain Downcast with example Explain

    Explain Downcast with example: It is a cast towards an object's dynamic kind - that is, `down' the inheritance hierarchy. For illustration:        // Downcast from Object to String

  • Q : What is Abstract method Abstract method

    Abstract method: This is a method with the abstract reserved word in its header. The abstract method has no method body. Methods stated in an interface are for all time abstract. The body of an abstract method should be stated in a su

©TutorsGlobe All rights reserved 2022-2023.