Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 309918 Details for
Bug 452235
java.util.Scanner.nextFloat() not working
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
the test program sources
Test.java (text/x-java), 876 bytes, created by
Andrea Santilli
on 2008-06-20 13:40:31 UTC
(
hide
)
Description:
the test program sources
Filename:
MIME Type:
Creator:
Andrea Santilli
Created:
2008-06-20 13:40:31 UTC
Size:
876 bytes
patch
obsolete
>import java.util.Scanner; >import java.io.*; > >public class Test >{ > public static void main(String args[]) > { > if (args.length != 1) { > System.err.println("Incorrect number of parameters."); > return; > } > > FileInputStream in=null; > try { > in = new FileInputStream(new File(args[0])); > } catch (FileNotFoundException e) { > System.err.println("File "+args[0]+" not found."); > return; > } > > Scanner sc = new Scanner(in); > String line = sc.nextLine(); > > Scanner ps = new Scanner(line); > > float val=0.0f; > try { > val = ps.nextFloat(); > } catch (java.util.InputMismatchException e) { > e.printStackTrace(); > System.err.println("Scanner.nextFloat() is screwed... let's try something else."); > try { > val = Float.parseFloat(ps.next()); > } catch (java.util.InputMismatchException e2) { > e2.printStackTrace(); > } > } > > System.out.println(val); > > } >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 452235
: 309918 |
309919