Question: Its a java program thank you 10) Say you write a program that makes use of the Random class, but you fail to include an
10) Say you write a program that makes use of the Random class, but you fail to include an import statement for java.util.Random (or java.util.). What will happen when you attempt to compile and run your program. 11) Public Class testl; public enum Fruits t mango, apple, pear, grapes; public String color; Fruits thisFruit public test 1 Fruits(Fruits anyFruit, String newColor) COLOR newColorr; FRUITS = ANYFRUIT; public static void main(Stringl Jargs) testI newObject new Fruits(red,yellow); System.out.println"This program is to test your understanding of enum"); Fruits newObject.mango; System.out.println" The fruits is"+fruits): Correct any syntax , runtime and logical errors errors or Rewrite the code with no erros. ii. What is the value of Fruits in the main program; ii. Instantiate any object in the main and assign the value pear
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
