1.Abstract class name {private string name; public abstract boolean isstupidName (String name) {}} heroes, what is wrong? Answer: wrong. Abstract Method must end with a semicolon and do not bring a curly bracket. 2.PUBLIC CLASS Something {Void Dosomething () {private string s = ""; int L = s.Length ();}} Is it wrong? Answer: wrong. No access modifiers (private, public, and protected) before local variables
. Final can be used to modify local variables (Final is like Abstract and Strictfp, all non-access modifiers, Strictfp can only modify Class and Method rather than variable). 3.Abstract Class Something {private abstract string dosomething ();} This seems to be nothing wrong? Answer: wrong. Abstract Methods cannot be modified in private. Abstract Methods is the specific details of the subclass item, how can I use Private to block AbstractMethod? (Simply, you can't add Final before Abstract Method). 4.public class something {public int address (femal int x) {return x;}} This is more obvious. Answer: wrong. INT X is modified to Final, meaning X cannot be modified in Addone Method. 5.
Public class something {public static void main (String [] args) {
Other o = new other (); new Something (). Addone (O); PUBLIC VOID ADDONE (FINAL OTHER O) {o.i ;}} Class Other {public INT i;} and above, all About Final problem, is this wrong? Answer: Correct. In Addone Method, the parameter O is modified into final. If we modified O's Reference in Addone Method (for example: o = new other ();), then this question is also wrong. But this is modified here that the MEMBER VAIRABLE (member variable) of O, while the REFERENCE does not change.