Java - Object-Oriented Programming Concepts
Given the class below, how can you create a method that returns a new
Rectangle object with double the width and height of the current one?class Rectangle {
int width;
int height;
Rectangle(int w, int h) {
width = w;
height = h;
}
// Your method here
}