It can stop the function when it’s no longer needed to keep running
And it can give a certain value to send back so it can be used elsewhere in your code
Answer:
Following are the program in java
public class Vehicle // class vehicle of type public
{
private int modelYear;
Vehicle() // no parameters
{
modelYear=2018;
}
vehicle(int t) // update the value of modelYear
{
modelYear=t;
}
public static void main(String args[]) // main function
{
vehicle ob=new vehicle();// creating instance
vehicle ob1=new vehicle(45);
}
}
Explanation:
Here we create a private data member i.e modelYear of integer type .
We create default constructor and initializes modelYear variable with 2018.
we create a parametrized constructor which update the value of modelYear variable.
From the main function we call both the constructors.
Answer:
Computer network reduces the operation cost as it allows to share software and hardware in the network.
Line 2 or line 4 sorry if I’m wrong