MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.Scanner;

public class MainClass {
    public static void main(String args[]) {
        Scanner sc = new Scanner("Name: Tom Age: 28 ID: 77");

        sc.findWithinHorizon("IDs:", 0);

        if (sc.hasNext())
            System.out.println(sc.next());
        else
            System.out.println("Error!");
    }
}