fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. List< String > devs = List.of( "Monter123" , "Epik_1" ) ;
  13.  
  14. String userInput1 = "Bob" ;
  15. boolean found1 = devs.contains( userInput1 ) ;
  16.  
  17. String userInput2 = "Epik_1" ;
  18. boolean found2 = devs.contains( userInput2 ) ;
  19.  
  20. System.out.println( userInput1 + " is dev: " + found1 ) ;
  21. System.out.println( userInput2 + " is dev: " + found2 ) ;
  22.  
  23. }
  24. }
Success #stdin #stdout 0.1s 50168KB
stdin
Standard input is empty
stdout
Bob is dev: false
Epik_1 is dev: true