- 1
A constructor program
DataMembers n:Integer MemberFunctions Special():Default Const.,To assign value 0 to n Special(int n):to assign avalue to n int fact(int n):returns factorial of a no. void sum():calculate the sum of 1st and last digit of n void isSpecial:check and display if n is a special no. or not
2 Antworten
0
Java Constructor Examples.Constructors are required to create objects for a class. Constructors are used to initialize the instance variables of an object. Constructor declaration looks like method declaration
0
...