Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Answer the given questions in the spaces provided. Your answers should be as con

ID: 3735010 • Letter: A

Question


Answer the given questions in the spaces provided. Your answers should be as concise as possible aim for two or three sentences 22. List the parts of a function header and why each one is important. 23. How are constructors and functions similar? How are they different? 24. What is the relationship berween a dient of an object and the object's public members? 25. What types of declarations are contained within a class definition 26. Distinguish between a primitive-type variable and a class-type variable.

Explanation / Answer

22)

Part of Function Header are

Function Name

This is important because of The function name and the parameter list together constitute the function signature

Parameters

A parameter is important because When a function is invoked, you pass a value to the parameter. This value is referred to as actual parameter or argument. The parameter list refers to the type, order, and number of the parameters of a function.

Function Body

The function body contains a collection of statements that define what the function does.

Return Type

Return type is important because function may return a value. The return type is the data type of the value the function returns.

23)

The definitions of constructors and function look like  similar in code.They can take parameters, they can have modifiers (ex:- public,private,protected), and they have method bodies.

constructor has same name as class.constructor is a special method present under every class that is always called when we create object of class.constructor does not return any value.Construcor invoke automatically when we creat a object of class.

Function can be called many number of times using the same object. function have return type.Functions are those which we have to call it explicitly.Function invoked using the dot operator.

24)

private members can not be access by the client object.public member and methods are access by the client object

client object call public method to manipulate the private data.

25)

class declaration contains declarations of the class variables,Access Modifiers, Function,constructors and methods.

26)

A primitive type variable can stores a value of its declaration type. like boolean, byte, char, short, int, long, float and double.reference-type variable can stores a reference to one object in memory.That object may be contain many element of data and also has methods for manipulating that data.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote