import java.util.*;
public class StringDemo{
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
System.out.println("Arguments are "+Arrays.toString(args));
System.out.println("Enter key: ");
String key=sc.nextInt();
for(int i=0;i<args.length;i++){
if(key.equals(args[i])){
System.out.println("Found");
}
break;
}
}
}
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter