subject

Public class illustrate
{
private int x;
private int y;

public illustrate()
{
x = 1;
y = 2;
}

public illustrate(int a)
{
x = a;
}

public void print()
{
system. out. println("x = " + x + ", y = " + y);
}

public void incrementy()
{
y++;
}
}
what does the default constructor do in the class definition above?

1. sets the value of x to 0
2. there is no default constructor.
3. sets the value of x to 1
4. sets the value of x to a

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 04:30
There is a simple pattern for determining if a binary number is odd. what is it and why does this pattern occur? how many bits would you need if you wanted to have the ability to count up to 1000? how high could you count in binary if you used all 10 of your fingers as bits? (finger up means 1, finger down means 0)
Answers: 3
question
Computers and Technology, 22.06.2019 19:20
1)consider the following code snippet: #ifndef book_h#define book_hconst double max_cost = 1000.0; class book{public: book(); book(double new_cost); void set_cost(double new_cost); double get_cost() const; private: double cost; }; double calculate_terms(book bk); #endifwhich of the following is correct? a)the header file is correct as given.b)the definition of max_cost should be removed since header files should not contain constants.c)the definition of book should be removed since header files should not contain class definitions.d)the body of the calculate_terms function should be added to the header file.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place?
Answers: 1
question
Computers and Technology, 24.06.2019 16:00
How are roger williams, james oglethorpe, and william penn similar?
Answers: 3
You know the right answer?
Public class illustrate
{
private int x;
private int y;

public i...
Questions
question
Arts, 05.07.2019 19:30
question
History, 05.07.2019 19:30
question
Computers and Technology, 05.07.2019 19:30
Questions on the website: 13722367