search
Login

Categories


C Books Guide and List
C++ Books Guide and List
Best Java Books

3.8k questions

4k answers

117 comments

10.7k users

1 vote
4.3k views
asked Sr Member 4.8k points 10 25 31

1 Answer

0 votes
This class is introduce java 1.5 version and it can be used to Read the contents from a resource.

import java.io.*;

import java.util.*;

class Read{

public static void main(String[] args) throws IOException{

Scanner s = new Scanner(System.in);

System.out.println(“Enter your age:”);

String str = s.nextLine();

Int age = Integer.parseInt(str);

System.out.println(“Age:” + age);

            }

}
answered Expert 15k points 15 23 30

Related questions

0 votes
1 answer 26 views
26 views
asked sunny Expert 11.4k points 14 22 28
0 votes
1 answer 107 views
107 views
asked augustaina Sr Member 4.8k points 10 25 31
0 votes
1 answer 58 views
58 views
asked taye Sr Member 5k points 7 9 12
0 votes
1 answer 37 views
37 views
what is the use of class in java
asked sara Guru 24.6k points 29 52 81
0 votes
1 answer 57 views
57 views
asked sara Guru 24.6k points 29 52 81
...