--%>

Explain State

State: The objects are said to possess state. The present state of an object is symbolized by the joint values of its attributes. Protecting the state of an object from unsuitable inspection or modification is a significant aspect of class design and we suggest the use of accessor and mutator methods to facilitate attribute integrity and protection. The design of a class is frequently an attempt to model the states of objects in real-world. Except there is a good match among the data types accessible in the language and the states to be modeled, class design might be complex. A significant principle in class design is to make sure that an object is never put into a contradictory state by responding to the message.

   Related Questions in Programming Languages

  • Q : Explain Default initial value Default

    Default initial value: It is the default value of any variable not explicitly initialized whenever it is declared. The fields of numeric primitive types contain the value zero by default, Boolean variables encompass the value false, char variables enc

  • Q : What is an Instance variable Instance

    Instance variable: It is a non-static field of a class. Each and every individual object of a class has its own copy of this field. This is in contrary to a class variable that is shared by all instances of class. Instance variables are employed to mo

  • Q : What is Super type Super type : It is a

    Super type: It is a type with a child sub type. The sub-type or super-type relationship is more common than the sub-class or super-class relationship. An interface which is implemented by the class is a super type of the class. The interface which is

  • Q : How XML web services integrate two

    How can XML web services integrate two legacy distributed systems, one based on Corba and one based on Java RMI?

  • Q : What is pipe What is meant by the term

    What is meant by the term pipe?

  • Q : When does a name clash take place in

    When does a name clash take place in programming?

  • Q : Who developed Extensible Hyper-Text

    Who developed Extensible Hyper-Text Markup Language? Answer: XHTML (Extensible Hyper-Text Markup Language) was developed by W3C HTML Working Group along with Steven

  • Q : Define the term Local inner class and

    Define the term Local inner class and Local variable: Local inner class: It is an inner class stated in a method. Local variable: It is a variable defined within

  • Q : Write a program that prints out all

    Write a program that prints out all prime numbers between 1 and 1000. Print the values out ten per line, with digits lined in proper columns.

  • Q : Write a program to print out ten random

    Write a program to print out ten random numbers from the following sets: a) {0, 1, 2, 3, 4, 5, ...99, 100} b) {1, 2, 3, 4, 5, 6} c) (10, 20, 30, 40, 50,...990, 1000} d) {-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5} e) {1.5, 2.0, 2.5, 3.0, 3.5}