ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Code-Snippets >> Programming-Code >> Java-Code >> J2EE-Code
 
 
 
Question
How to convert string containing decimal point into integer
in java? For example given a string like "3.14" as input how
to get integer 3 as result.
 Question Submitted By :: Pradeep
I also faced this Question!!     Rank Answer Posted By  
 
Answer
class StringToInt {
	public static void main (String[] args) {
    String s="3.14";
    double i=Double.parseDouble(s);
    int i1=(int)i;
    System.out.println (i1);
 
    }
}
 
0
Indresh_ips
[Yen Exall Soft Pvt.ltd]
 
View All Answers
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com