1. When using encapsulation how should data be shared with the external code?                                  
a.)  Events
b.)  Methods
c.)  Properties
d.)  Private variables
e.)  Public variables

Answer: c




2. Which statement is true?
a.)  A base class inherits some of the properties of a derived class.
b.)  A base class inherits all of the properties of a derived class.
c.)  A derived class inherits some of the properties of a base class.
d.)  A derived class inherits all of the properties of a base class.
e.) None of the above.

Answer: d

3. When a base class is changed:
a.)  there is no effect on the derived class.
b.)  the derived class changes when the keyword Overridden is used.
c.)  only the methods of the derived class change.
d.)  only the properties of the derived class change.
e.)  the derived class automatically changes.

Answer:  e

4. Polymorphism can apply to:
a.)  math operators.
b.)  method names.
c.)  object names.
d.)  Both a and b.
e.)  All of the above. 

Answer:  d

5. With polymorphism:
a.)  one method can have multiple names.
b.)  one object can have multiple names.
c.)  many methods can share the same name.
d.)  many objects can share the same name.
e.)  None of the above statements are true.

Answer:  c

6. Which element of a class is optional?                                 
a.)  Constructs
b.)  Fields
c.)  Methods
d.)  Properties
e.)  All of the above. 

Answer: e

7. What is the suggested order for the definition of class elements from first to last?
a.)  Constructs, fields, methods, properties
b.)  Properties, constructs, fields, methods
c.)  Fields, properties, constructs, methods
d.)  Constructs, properties, fields, methods
e.)  Methods, constructs, properties, fields

Answer: c

8. The standard for designing a field is that it be defined as a:
a.)  private method.
b.)  public method.
c.)  private variable.
d.)  public variable.
e.)  None of the above.

Answer: c




9. What is the syntax for making a property read-only?
a.)  Property Read propertyname As datatype
b.)  Read Property propertyname As datatype
c.)  ReadOnly Property propertyname As datatype
d.)  Read-Only Property propertyname As datatype
e.)  RO Property propertyname As datatype

Answer: c

10. The Get procedure of a property acts like:
a.)  an event.
b.)  a function.
c.)  a variable.
d.)  Both a and b.
e.)  All of the above. 

Answer: b

11. A method in a class is:                                 
a.)  a sub procedure.
b.)  a function.
c.)  an event.
d.)  Both a and b.
e.)  All of the above. 

Answer: d

12. How many constructors can a class have?
a.)  0
b.)  1
c.)  2
d.)  3
e.)  All of the above. 
  
Answer:  e

13. A constructor is a special type of:
a.)  class.
b.)  field.
c.)  method.
d.)  property.
e.)  variable. 
  
Answer:  c

14. Which is true for constructors in a class?
a.)  All constructors must have the same number of parameters.
b.)  All constructors must be the same parameter data type.
c.)  Some constructors can have the same list of parameters.
d.)  Only two constructors in a class can have the same list of parameters.
e.)  No two constructors in a class can have the same list of parameters.
  
Answer: e




15. Which statement will call a constructor of a base class?
a.)  Base.New( )
b.)  BaseConstructor.New ( )
c.)  CallBase.New( )
d.)  Constructor.New ( )
e.)  MyBase.New( )
  
Answer: e
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: