![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java学习
文章平均质量分 78
practiceperfect
这个作者很懒,什么都没留下…
展开
-
C++和JAVA实例化对象的区别
JAVA:A a = new A();为A对象创建了一个实例,但在内存中开辟了两块空间:一块空间在堆区,存放new A()这个对象;另一块空间在堆栈,也就是栈,存放a,a的值为new A()这个对象的内存地址。因为java在JVM中运行,所以a 描述的内存地址不一定是这个对象真实内存的地址。Object o; // 这是声明一个引用,它的类型是Object,他的值为null,还转载 2013-05-30 17:31:55 · 3601 阅读 · 0 评论 -
android 开发中获取View视图的宽和高的几种方法
首先,有一点需要声明,其实在android中,画布Canvas的高宽其实是屏幕的高宽。如此一来,获得屏幕高宽的方法就很多了:1.WindowManager windowManager = getWindowManager();Display display = windowManager.getDefaultDisplay();screenWidth = display.get转载 2013-05-31 09:25:19 · 4226 阅读 · 0 评论 -
android中layout_weight的理解
SDK中的解释Indicates how much of the extra space in the LinearLayout will be allocated to the view associated with these LayoutParams. Specify 0 if the view should not be stretched. Otherwise the extra转载 2013-06-01 12:10:35 · 648 阅读 · 0 评论