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  Contact Us     Login  |  Sign Up                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
How to convert String into primitive datatype.
 Question Submitted By :: Raseek
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How to convert String into primitive datatype.
Answer
# 1
convert int to string
 
Is This Answer Correct ?    2 Yes 8 No
Srinu
 
  Re: How to convert String into primitive datatype.
Answer
# 2
using parseInt() method for example

//String to primitive types
    int  iVal = Integer.parseInt(str);
    long  lVal = Long.parseLong(str);
    float  fVal = Float.parseFloat(str);
     double dVal = Double.parseDouble(str);
 
Is This Answer Correct ?    18 Yes 1 No
Vikki
 
 
 
  Re: How to convert String into primitive datatype.
Answer
# 3
by using parseing methode of String class
 
Is This Answer Correct ?    0 Yes 3 No
Nilesh
 
  Re: How to convert String into primitive datatype.
Answer
# 4
by using parsing methods of the respective primitive type like if we want to convert into int then use parseint() , if float then  use parsefloat()...
 
Is This Answer Correct ?    0 Yes 0 No
Niranjan Sahoo
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Does a class inherit the constructor of its super class?if it does, how can you hide that constructor? if it doesnot how can you call it from the sub class?  1
How multi processing is achieved in JAVA? BMC4
What is the use of bin and lib in JDK?  3
Is JRE required to compile Java files ? HCL3
In C we use only compiler. Why java uses both compiler and interpreter? What is its significance?  5
What is meant by class loader and how many types are there? Apple1
Which all r Final classes in java except string?  3
Can we instantiate Interfaces? Ericsson4
what is the difference between the "protected and default" modifiers?  4
What are the two major components of JDBC? Mind-Tree4
What is the smallest package in Java API?  4
C and C++ has constructors and distructors, why does Java does not have distructors? T3-Softwares1
What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?  5
How to override a equals() method and what is the use?  1
explain the classification of exception and hoew to handle the exceptions  2
waht happens when a return type ,even void is specified for a constructor?  10
what is the difference between HashMap And HashTable? Hexaware3
What is the return type of a program?s main() method?  2
What is a super class and how super class be called?  3
What is Session and cookies?Explain in detail with an example? CTS2
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

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