Hi, so I need help with this program. I have to write a method called censor that gets an array of strings from the user as an argument and then returns an array of strings that contains all of the original strings in the same order except those with length of 4. For example if cat, dog, moose, lazy, with was entered, then it would return the exact same thing except for the words with and lazy. Any thoughts? Currently, my code so far just prints [Ljava.lang.String;@38cfdf and im stuck. Thank you very much in advance.
import java.util.Scanner; public class censorProgram { public static void main (String args[]){ Scanner input = new Scanner (System.in); System.out.println ("How many words would you like to enter?"); int lineOfText = input.nextInt(); System.out.println ("Enter your words."); String [] words = new String [lineOfText]; for (int i = 0; i < words.length; i ++){ words[i] = input.next(); } System.out.println (words); } } // prints [Ljava.lang.String;@38cfdf //have to make new string array in the method and return words without four letters in the main method