Objects to model the world:
An object is something that has a state: it has associated with it some variables whose values define that state. When we write programs, we have to decide which parts of the world we want to represent as objects in our programs. We also need to determine what aspects of their state we want to represent.
Here are some examples.
- A bank account could be modelled as an object whose state may be the name of the account holder, the current balance, the overdraft limit and a list of recent transactions.
- An aeroplane in an air-traf?c control system could be modelled as an object; its state might consist of data that identifies the plane, its position and its eventual destination.
- A pull-down menu in the user interface of an applet may be modelled as an object; its state might consist of a list of the commands for the pull-down menu, the type of box that encloses the menu when it is on screen and its colour.
Another important feature of objects is that we can invoke methods on them. For example, the expression:
obj.setA(2);
has the interpretation that the method with name setA is invoked on the object obj.
An applet or application is a collection of communicating objects. The means of this communication is via methods, which allow data to be passed in to objects (by method arguments) and out of objects (as values returned by methods).
For example, assume that we have a simple word-processing application and a user wishes to count the number of words in a document. The user might pull down a menu that contains the 'word count' command, click on this command and see the word count displayed on the screen. This seemingly simple piece of processing will contain considerable work 'behind the scenes' and would involve communication between a number of objects.
It might go as follows.
- The user interface object invokes a method of the pull-down menu object, resulting in the display of the pull-down menu.
- The pull-down menu object returns a value identifying that the user has selected the 'word count' command.
- The document object invokes a method to count the words in the document, with a count being incremented each time a word is found.
- A method is invoked on the window object, asking it to display the word count on the user's computer screen.
Java Assignment Help - Java Homework Help
Struggling with java programming language? Are you not finding solution for your Objects to model the world homework and assignments? Live Objects to model the world experts are working for students by solving their doubts & questions during their course studies and training program. We at Expertsmind.com offer Objects to model the world homework help, java assignment help and Objects to model the world projects help anytime from anywhere for 24x7 hours. Computer science programming assignments help making life easy for students.
Why Expertsmind for assignment help
- Higher degree holder and experienced experts network
- Punctuality and responsibility of work
- Quality solution with 100% plagiarism free answers
- Time on Delivery
- Privacy of information and details
- Excellence in solving java programming language queries in excels and word format.
- Best tutoring assistance 24x7 hours