(ix) Consider the following program segment and answer the questions 21 below:
class calculate
{
int a; double b;
calculate()
{
a=0;
b=0.0;
}
calculate(int x, double y)
{
a=x;
b=y;
}
void sum()
{
System.out.println(a*b);
}}
System.out.println(a*b);
Name the type of constructors used in the above program segment?


Solution



Default constructor, Parameterized Constructor



Reach Us

SERVICES

  • ACADEMIC
  • ON-LINE PREPARATION
  • FOUNDATION & CRASH COURSES

CONTACT

B-54, Krishna Bhawan, Parag Narain Road, Near Butler Palace Colony Lucknow
Contact:+ 91790552 9739