title: How to take only the integer input from a Sentence?
body: <p>I want to get the integers or float or double values from a sentence. As an example - &quot;John has 20 balls, from which 4 are red and 5 are green balls&quot;. this will be my input . I want to get the numbers 20 , 4 , 5 from that line. how to do that in java . Please tell me if i can do that using Scanner. I don't want to use bufferedreader.</p>