No "J"

Report a typo

Implement a method that does the following algorithm:

  1. creates List<String> from a given array of strings;
  2. using ListIterator, removes all items not starting with "J" ;
  3. removes "J" from items beginning with "J" (e.g., JFrame -> Frame);
  4. prints all the remaining elements in the reverse order.

Sample Input 1:

ImageButton JTextField JTextArea CheckBox JMenu

Sample Output 1:

Menu
TextArea
TextField
Write a program in Java 17
import java.util.*;

public class Main {

public static void processIterator(String[] array) {
// write your code here
}

/* Do not change code below */
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
processIterator(scanner.nextLine().split(" "));
}
}
___

Create a free account to access the full topic