Quiz


1.  

What is an interface?

an interface specifies what a class must do, but not how it does it. it is syntactically similar to a class, but its methods are declared without any body. a class implements an interface by creating a complete set of methods defined by the interface.

2.  

What is an interface diagram?

an interface diagram shows how a class can implement an interface.

3.  

Why is an interface used in a program?

an interface is used in a program to enable similar classes to have a standard behavior while having the programmer who builds these classes define how the behavior is performed.

4.  

What is the difference between an interface and a user interface?

the purpose of a user interface is to enable a user to use a program. an interface is a standard behavior. programmers who use a class that implements an interface can expect that the class will define a set of standard methods. programmers who build classes for use by other programmers must define a set of standard methods that conform to a standard interface.

5.  

Does the C programming language use interfaces?

the c programming language doesn t use an interface because c is not an object-oriented programming language.

6.  

What kind of inheritance is similar to an interface?

an interface is similar to multiple inheritance.

7.  

Can an interface be used with C++?

c++ does not support an interface, but it does support multiple inheritance.

8.  

Why do Java and C# support interfaces?

java and c# support interfaces because they do not support multiple inheritance.

9.  

What is a component?

a component is a class designed to fit into some preexisting class framework and may do so through inheritance or by implementing one or more interfaces. however, it must follow its environment s rules for components.

10.  

Give an example of a component.

an integrated development environment is a good example because it enables programmers to drag and drop components such as buttons from a tool palette onto a form.

Answers

1.  

An interface specifies what a class must do, but not how it does it. It is syntactically similar to a class, but its methods are declared without any body. A class implements an interface by creating a complete set of methods defined by the interface.

2.  

An interface diagram shows how a class can implement an interface.

3.  

An interface is used in a program to enable similar classes to have a standard behavior while having the programmer who builds these classes define how the behavior is performed.

4.  

The purpose of a user interface is to enable a user to use a program. An interface is a standard behavior. Programmers who use a class that implements an interface can expect that the class will define a set of standard methods. Programmers who build classes for use by other programmers must define a set of standard methods that conform to a standard interface.

5.  

The C programming language doesn t use an interface because C is not an object-oriented programming language.

6.  

An interface is similar to multiple inheritance.

7.  

C++ does not support an interface, but it does support multiple inheritance.

8.  

Java and C# support interfaces because they do not support multiple inheritance.

9.  

A component is a class designed to fit into some preexisting class framework and may do so through inheritance or by implementing one or more interfaces. However, it must follow its environment s rules for components .

10.  

An Integrated Development Environment is a good example because it enables programmers to drag and drop components such as buttons from a tool palette onto a form.




OOP Demystified
OOP Demystified
ISBN: 0072253630
EAN: 2147483647
Year: 2006
Pages: 130

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net