Question 23 Examine the code below and briefly explain why it will not work and at least one way the issue could be resolved. public class MyPublicClass ( 3 public static void main(String[] args) ) MyOtherClass ac now MyOtherClass(1); class MyClass ( private int x; public MyClass() ( ) x=0; 9 class MyotherClass extends MyClass ( public int y public MyotherClass(int input) y-x input, 4 pts
Question 17 4 pts Using pseudocode, pseudo-Java, or Java, write code below that does the following: Positive Numbers Only: Create a static method that takes in an array as its input. The method goes through the array and if it finds a negative number it changes the value within the array to 0. For example: (1.-5, 10, 6, 0, -2, 81 would change to: [1, 0, 10, 6, 0, 0, 8] Note: Only the static method is required. You do not have the include the main method or the public class that it belongs to.
Question 23 Examine the code below and briefly explain why it will not work and at least one way the issue could be reso
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am