Java function

import java.util.Arrays;import java.util.Scanner;public class IncrementMain { public static void main(String[] args) { Scanner console =new Scanner(System.in); System.out.println(“How big do you want your box to be?”); // creating the length of the box based on user input int user1 = console.nextInt(); int[] thisboxlength =new int[user1]; // how big there box is going to be for both subclasses System.out.println(“Sequential Incermenter: “); SequentialIncermenter result =new SequentialIncermenter(thisboxlength);// calling the constructor SequentialIncermenter System.out.println(Arrays.toString(result.getValue(user1))); // returning user1’s input from subclass System.out.println(“Random Incrementer: “); RandomIncrementer result2 =new RandomIncrementer(thisboxlength); // calling the constructor RandomIncrementer System.out.println(Arrays.toString(result2.getValue(user1))); // returning user1’s input from subclass }}

Leave a Reply

Your email address will not be published. Required fields are marked *