What is a constructor? Explain the difference between a default constructor and a parameterized constructor.

What will be an ideal response?


A constructor is a class method, always named New, whose sole purpose is to initialize the class's Private variables. Constructors never return a value, so they are always Sub procedures and not Function procedures. A default constructor is a constructor that has no parameters. A parameterized constructor contains one or more parameters.

Computer Science & Information Technology

You might also like to view...

Suppose that a recursive function with integer parameter n has a base case of 0, and for each non-base case, the function makes a recursive call with argument n+1. If the function is initially called with an actual argument of n = 3, the function call will

A) cause an infinite chain of recursive calls. B) return after a chain of 2 recursive calls. C) return after a chain of 3 recursive calls. D) return after a chain of 4 recursive calls. E) None of the above

Computer Science & Information Technology

____________ are used by professional programmers to embed extensive documentation in a program’ source code.

a. Line comments b. Block comments c. Documentation comments d. Embedded comments

Computer Science & Information Technology

A breadth-first search is a search conducted on a graph such that:

A. the shortest paths are found between a chosen vertex and any other vertex B. the breadth array of the graph is searched first for the desired information C. the breadth linked list of the graph is search first for the desired information D. None of the above

Computer Science & Information Technology

A service to solve the problem of minimizing the number of times that a user has to enter a password and the risk of an eavesdropper capturing the password and using it is known as the __________ .

A. authentication server B. ticket granting server C. Kerberos mutual authentication D. PCBC mode

Computer Science & Information Technology