3. The following code is ILLEGAL for two reasons. Explain what ONE of the two issues are AND propose a viable solution t
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
3. The following code is ILLEGAL for two reasons. Explain what ONE of the two issues are AND propose a viable solution t
3. The following code is ILLEGAL for two reasons. Explain what ONE of the two issues are AND propose a viable solution to fix said problem. Please keep the following conditions in mind: 1. The declarations of the 'alpha' and 'beta' attributes must remain in tact. • Same thing applies for the header of the class. 2. Unless stated otherwise, your solutions can add, remove, and/or edit any of the existing code within class 'Foo' TIP: Your top priority is to make the code compilable / syntactically legal. 3. HINT: Any code that could exist outside of class 'Foo' is irrelevant. //DO NOT CHANGE this line. public class Foo { static int alpha; double beta; // !!DO NOT CHANGE!! //These two lines of code. public Foo() { beta = "3": double X = bar(3); public static double bar(int x) { alpha = x; return beta; }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!