Programming tips

1 . Use the enhanced loop

[code language=”java”]
String[] words = {"apple","pear","potato","tomato"};

for(String w : words){

if(w.startsWith("fu"))

System.out.println(w+" starts with fu")};
[/code]

Leave a Reply

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