/* * * Author: J Sun * 10/7/07 */ import java.util.Scanner; public class StarMethod { public static void main(String[] args) { Scanner scan = new Scanner (System.in); String user = ""; int indexOf = 0; of stars String yesNo = ""; System.out.println("Enter something."); user = scan.nextLine();
//imports scanner //userinput //the number for the index //true or false value //asks user for input //scans info
if (user.length()<0||user.indexOf('*')<0) //if a string does not have any info and no star yesNo = "false"; //returns false else if (user.length()>0&&user.indexOf('*')>0)//if it does yesNo = "true"; //returns true System.out.println(yesNo);
} //psvm } //pcSM
//output.