One,
GetClass Method:Type: public final class getclass ()Function: Returns the Java.lang.Class object of the Run-time class of the object (interpretation on the API)There is a method type to know that the method can only be invoked by an instance
For example:Class a{}public class B extends a{public void Test () {System.out.println (Super.getclass (). GetName ());}Publis static void Main (string[] args) {New B (). Test (); The resulting output is B, not aThe parent class name (reflection
First, let's give a question. What is the output result of the following program?
Java codeImport java. util. Date;Public class Test extends Date {Public static void main (String [] args ){New Test (). test ();}Public void test (){System. out.
The super. getClass method of Java interview questions is called. Today, I read a Java interview question from the Internet, and the result fell into the trap. I think this interview question is quite good, so I will share it with you! Let's take a
Java Reflection LearningThe so-called reflection can be understood as the operation of obtaining the object type information during the run time. Traditional programming methods require programmers to decide which type to use during the compilation
Java code Import java.util.date; Public class Test extends date{ &NBSP public static void Main (string[] args) { &NBSP new Test (). Test (); &NBSP }&NBSP public void Test () {
To explain the problem, let's take a look at the following code:Package Com.yonyou.test;import Java.util.date;class Test extends date{private static final long Serialversionuid = 1l;pub Lic static void Main (string[] args) {new Test (). print ();}
1. The Hashcode () method of the object class is as follows:public int hashcode (): Returns the hash code value of the object, which is related to the address value, but not the actual address value (the hash value is an integer value converted from
Java Tour (ix)--object class, Equals,tostring,getclass, inner class access rule, static inner class, Inner class principle, anonymous inner class
Every day by some trivial harassment, learning to continue
I. Object class
What
1 ImportJava.util.HashSet;2 ImportJava.util.Iterator;3 4 /**5 * Created by GOD on 2016/1/23.6 * The Class object is generated in the following way:7 1. Class Name: The JVM will use the class loader to load the class into memory (provided that the
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.