Source Code:
public class EvenLengthWords {
public static void main(String[] args) {
String s = “This is a java class”;
String[] words = s.split(” “);
for(int i=0; i<words.length; i++) {
if(words[i].length() % 2 == 0) {
System.out.println(words[i]);
}
}
}
}
Output:
