Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Standard view
Full view
of .
Look up keyword
Like this
0 of .
Results for:
No results containing your search query
P. 1
Chapter 22

Chapter 22

Ratings: (0)|Views: 7|Likes:
Published by nishii87

More info:

Published by: nishii87 on Nov 15, 2009
Copyright:Attribution Non-commercial


Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less





Q.1.What do the letters AWT stand for?A.1.AWT stands for Abstract Windowing Toolkit and it a portion of the Java library.Q.2.Explain the relationship between the various parts in the manipulation of alayout manager.A.2. In the manipulation of the layout manager there are three differentmechanisms: inheritance, composition and implementation of an interface.Inheritance links the application clas to the parent window class. This allows thecode written in the AWT class to perform application specific actions by invokingmethods in the application class that override methods in the parent class. The factthat composition is used to link the container with the layout manager makes thelink between these two items very flexible and dynamic-the programmer can easilychange the type of layout manager being used by a container. Finally the fact thatthe layout manager is an interface means that the programmer is free to developalternative layout managers instead of extending this class every time.Q.3.What is a listener? When does a listener get invoked?A.3.A listener is an object whose sole purpose is to sit and wait for an event tooccur. When an event occurs, the listeners are notified, and they take theappropriate action.Q.4.What purpose is being addressed by the mouse adapter?A.4.
More often than not, programmers are interested in only one or two eventsthat a mouse does (like a mouse click, mouse enter, mouse exit, mouse press,mouse release etc.) not all the possible events defined by the interface. The mouse adapter provides empty implementations, allowing the programmer toredefine only the events of interest.
Q.1.How are object connections related to name visibility?A.1.Visibility describes the characterization of names-the handles by which objectsare accessed. An object is visible in a certain context if its name is legal anddenotes the object.Q.2.What does the term coupling mean?
Coupling refers to the extent to which one component uses another to performactions. A general goal in designing is to reduce coupling between software.Q.3.Why is internal data coupling a bad idea?A.3.Internal data coupling is considered bad because it makes it difficult tounderstand a class in isolation and requires one to go through several classes orblocks of code to understand the functionality of another.Q.4.What is the difference between file scope (package in some languages) andprogram scope?A.4.There are two varieties of global variables depending on their scope in a code. Those that have a file scope are used only inside one file but those with a programscope can be potentially modified anywhere in a program.Q.5.What is sequence coupling?A.5. Sequence coupling is when objects are linked by the fact that one must bemanipulated before the other, but otherwise they have no connection.Q.6.What is component coupling? Why do we say that this coupling is only one way?A.6.
Component coupling occurs when one class maintains a data field or value thatis an instance of another class. This kind of coupling is one way because here the container clearly has knowledgeof the class of value it maintains, but the element being held should have noknowledge of the container in which it is being used.Q.7.What is parameter coupling?A.7.Parameter coupling occurs when one class must invoke services and routinesfrom another and the only relationships are the number and the type of parameterssupplied and the type of value returned.Q.8.What is the term used for the relationship between a parent class and a childclass?A.8.Subclass coupling is the term used for the relationship between a parent classand a child class.Q.9.What is cohesion?A.9.
Cohesion refers to the extent to which the actions of a component seem to betied together in purpose. Generally a goal is to increase cohesion within a softwarecomponent.

You're Reading a Free Preview

/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->