Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner; // this is so we can get input from the user
- public class MainClass {
- public static void main(String[] args) {
- data = "THIS IS THE SHIT THAT I'M GOING TO BE SEARCHING FOR!!"
- String search;
- System.out.println("What do you want to search for?");
- // instantiate an object of scanner (to get user input
- Scanner input = new Scanner(System.in);
- search = input.next(); // we'll assume I inputted "is"
- int loc = SearchForThings.search(data, search);
- System.out.println("The location of the word is " + loc + ".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement