Engineering Full Stack Apps with Java and JavaScript
Given:
class Square { private double side = 0; String color; public Square(double length){ this.side = length; } public double getSide() { return side; } public void setSide(double side) { this.side = side; } } public class TestClass { public static void main(String[] args) throws Exception { Square mysq = new Square(10); mysq.color = "red"; //set mysq's side to 20 } }
Which of the following statements will set mysq's side to 20?
Select 1 option
A. mysq.side = 20;
B. mysq = new Square(20);
C. mysq.setSide(20);
D. side = 20;
E. Square.mysql.side = 20;