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[]) {
        String instr = "10 99.88 scanning is easy.";
        Scanner conin = new Scanner(instr);

        while (conin.hasNext()) {
            if (conin.hasNextDouble()) {
                System.out.println(conin.nextDouble());
            }
        }

    }
}