During debugging in Android development, we often need to output class data.For example, we often need to check the following data types.
Public class data {private int ID; private string name; private string URL; private Bitmap bitmap; private long T; private string status; Public int GETID () {return ID ;} public void setid (int id) {This. id = ID;} Public String getname () {return name;} public void setname (string name) {This. name = Name ;}//...... save layout}
The Code is as follows:
T
Reprinted from: http://www.51edu.com/it/2008/1120/article_3272.html
There are several phenomena that need to be summarized:In Java, the base class of the error class is Java. Lang. error, and the base class of the exception class is Java. Lang. Exception.Similarities:
get the desired results. Although some Lang Methods overlap some methods in j2se, in most cases, a Lang method can provide the functions of multiple j2se methods in various types, to help you obtain the required output.The Lang component has many classes specifically used for string operations. Now we will use a simpl
finallize to force execution or write your own finallize method.
========================================================== ==========Tomcat
Tomcat error: Java. Lang. outofmemoryerror: Java heap space, so I checked the information and found the solution:If Java runs out
Java reflection mechanism (Java reflect):
In the Java Runtime environment, for any class, you can tell what properties and methods the class has. For any object, can call his method. The answer is yes, this dynamic acquisition of class information, and the ability to dynamic
Java-reflect Special Topic (reflection)· The use of class classes• Reflection of the method• Reflection of Member variables• Reflection of the constructor function· Java class loading mechanism1 Use of Class1) In an object-oriented world, everything is object.In the Java lan
Reflection: When a bytecode file is loaded into memory, the JVM will dissect the bytecode and then create an object's class object, storing all the information of the bytecode file in the class object, and we just get to the class object, We can use the bytecode object to set the properties of the object or invoke the object's methods, and so on.The simple use of reflection is recorded here for easy reference1 /*******************2 Get class3 *******************/4 //Class
The reflect class is provided in Java to help us complete the traversal of the properties of the Java class, and it can be used to complete the modification of the property. Two ways of doing this are provided in the following example:
1. Direct use of field.get and field.set operations
2. Use the Object.getclass (). GetMethod ()
instance object.3. When you create an instance object, you should first give an example of what is normally done, string str = new String (New StringBuffer ("abc")), and in the source program the traditional way of code is given in order to compare the reminder reader to the viewer.And say how to do it with reflection.String str = (string) constructor.newinstance (/* "abc" */new StringBuffer ("abc"));System.out.println (str);When you create an instance object by means of a reflection, you first
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.