-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWrapper_Double1.java
More file actions
58 lines (32 loc) · 1.13 KB
/
Wrapper_Double1.java
File metadata and controls
58 lines (32 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package com.testing250.JavaDay2;
public class Wrapper_Double1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Wrapper_Double1 test1 = new Wrapper_Double1();
double pricetest=test1.ConvertToDouble("997.67");
System.out.println("Converted Price is :" + " " + pricetest);
int idn = test1.ConvertToInt("998067");
System.out.println("Converted id in int:" + idn+8);
float v = test1.ConvertToFloat("98.08");
System.out.println(v);
String res5=test1.Convert_double_str(980.80);
System.out.println(res5.concat("test"));
}
public double ConvertToDouble(String price) {
double priceVal = Double.parseDouble(price);
//System.out.println(priceVal);
return priceVal;
}
public String Convert_double_str(double data6) {
String p1 = String.valueOf(data6);
return p1;
}
public int ConvertToInt(String idnum) {
int idnum1 = Integer.parseInt(idnum);
return idnum1;
}
public float ConvertToFloat(String flval) {
float data = Float.parseFloat(flval);
return data;
}
}