How to convert String into primitive datatype.
Answers were Sorted based on User's Feedback
Answer / akshya kumar
using the wrapper classes, by using the function in
following way:
int i_var = Integer.parseInt(string_var); //and as in
answer #2
Integer, Float, Long are wrapper classes predefined in JAVA
with methods parseInt(), parseFloat etc respectively.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / akshya kumar
we can also use valueOf method of wrapper classes like:
int i_var = Integer.valueOf(string_var);
float f_var = Float.valueOf(string_vatr);
Is This Answer Correct ? | 4 Yes | 1 No |
Answer / niranjan sahoo
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 ? | 3 Yes | 3 No |
Write program to print Hello World and print each character address in that string and print how many times each character is in that string? Ex: H: 0 & 1 e:1 & 1 l :2,3,8 & 3 o:4,6 & 2 w:5 & 1 r: 7 & 1 d 9 & 1
What are virtual methods?
how to print the below in java? * * * * * * * * *
What are some examples of variable costs?
Why use string handling in Java?
Is array serializable java?
What is entry in java?
What is the default value of local and global variables?
what is the Diff. between Access Specifiers and Access Modifiers?
39 Answers BMC, Cyber Shot, Infosys, VTS, Wipro,
explain different ways of using thread? : Java thread
Discuss 2D arrays.
Hi ,i convert contrller as jSp And presentation as servlet ...will it do? if so what are advantage and idsadvantages