new Integer(100)把new出来的对象放到哪里呢?懂JAVA的进..
来源:百度知道 编辑:UC知道 时间:2024/05/13 07:54:41
比如如下的程序:
public class test{
public static void main(String []args){
new Integer(100);
}
}
public class test{
public static void main(String []args){
new Integer(100);
}
}
1,2楼,楼主没说把 new Integer(100)赋给对象好不好。。
光说 new Integer(100)的话只是把100封装类里面,实际上是在堆内存中的,并没有赋给某个对象
在举个例子,比如int i = 100,是放在栈内存当中。
你得自己新建个变量放这个整数
int i = new Integer(100);
public class test{
public static void main(String []args){
Integer i= new Integer(100);
}
}
对象放在堆里
Integer id = new Integer(request.getParameter("id"));是从页面上取出 id值放在integer id中,
Integer.toString()
integer.parseInt()
integer问题
Dim a As Integer, b As Integer, c As Integer, aa As Integer, bb As Integer
Dim i As Integer,j As Integer
Integer.valueof() Integer.parseInt() 有什么区别?
Private x As Integer
integer,longint的区别?
什么是32bit integer?