1. Can the constructor Constructor be override?
A: The constructor Constructor cannot be inherited, so overriding cannot be overridden, but can be re-
Load overloading.
2.
Two object values are the same (x.equals (y) = = true), but can have different hash code, which
A sentence, right?
Answer: No, there is the same hash code.
3.
Can I inherit the String class?
A: The String class is the final class and therefore cannot be inherited.
4.
The following two statements return a value of true:
A: "Beijing" = = "Beijing";
B: "Beijing". Equalsignorecase (New String ("Beijing"));
Answer: A and B.
5.
When an object is passed as a parameter to a method, this method can change the properties of the object.
And can return the result of the change, so is it a value pass or a reference pass?
A: The value is passed. The Java programming language has only value-passing parameters. When an object instance is used as a parameter
When passed to a method, the value of the parameter is a reference to the object. The contents of the object can be called in the
method, but the object's reference is never changed.
Classic Questions (1)