Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.56 KB | None | 0 0
  1. import java.util.Scanner; // this is so we can get input from the user
  2.  
  3. public class MainClass {
  4.  
  5. public static void main(String[] args) {
  6. data = "THIS IS THE SHIT THAT I'M GOING TO BE SEARCHING FOR!!"
  7.  
  8. String search;
  9.  
  10. System.out.println("What do you want to search for?");
  11.  
  12. // instantiate an object of scanner (to get user input
  13. Scanner input = new Scanner(System.in);
  14.  
  15. search = input.next(); // we'll assume I inputted "is"
  16.  
  17. int loc = SearchForThings.search(data, search);
  18.  
  19. System.out.println("The location of the word is " + loc  + ".");
  20.  
  21. }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement