Developer community
+1 vote
4.3k views
asked by Sr Member (4.8k points) 10 23 31 | 4.3k views

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 by Expert (15k points) 15 23 29

Related questions

0 votes
1 answer
asked by sunny Expert (11.4k points) 14 22 29 | 25 views
0 votes
1 answer
asked by augustaina Sr Member (4.8k points) 10 23 31 | 95 views
0 votes
1 answer
asked by taye Sr Member (5k points) 7 9 12 | 53 views
0 votes
1 answer
asked by sara Guru (24.6k points) 29 51 77 | 38 views
0 votes
1 answer
asked by sara Guru (24.6k points) 29 51 77 | 55 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


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

3.8k questions

4k answers

117 comments

10.7k users

3,751 questions
4,046 answers
117 comments
10,709 users