This is an object of its own, representing the object itself, which can be understood as: A pointer to the object itself.The usage of this can be broadly divided into 3 types in Java:1. Normal Direct referencesThis does not have to be said, this is equivalent to pointing to the current object itself.2. The name of the member who participates in the membership is distinguished by this:Class Person { private int: age = ten; Public person () { System.out.println ("Initialization Age:" +ag
Ext: 52205961The Python language has similar class inheritance to C + +, in which Python customizes the first self, like the this pointer in C + +, to the object itself.Examples of simple Python classes:[Python]View PlainCopy
>>> class Hello (object):
... def print_c ():
...print"Hello world!"
>>> hello (). Print_c ()
Hello world!
Of course, in practice, the inevitable need for class inheritance, subclasses inherit the parent class, normal as follows:[Python]View
The Python language has similar class inheritance to C + +, and in the class definition, Python customizes the first self, similar to the this pointer in C + +, pointing to the object itself.
Examples of Python simple classes:
>>> class Hello (object):
... Def print_c ():
. print "Hello world!"
>>> hello (). Print_c ()
Hello world!
Of course, in practice, the inevitable need for class inheritance, subclass inherits the parent class, normal as follows:
>>> class Child (Hell
A brief analysis of new,this,super,final keywords in Java
New Keyword
For example people person=new people ();
create an object what does it do in memory? load the People.class file at the specified location on the hard disk into memory first. When executing the main method, the Main method's space (stack-stack) is opened in stack memory, and a variable person is assigned to the stack area of the main method. Creates an entity space in the heap memo
Java Object-oriented-–super keywords
1: Define father (parent Class) class
1: member variable int x=1;2: Construction method without parameter and argument, with output statement
2: Define son class extends Father class
1: member variable int y=1;2: The construction method is non-parametric and has a parameter. have output statement this.y=y+x;
3: Create son class object
Son son=new Son(3); Sy
Like what
class Child (Parent): def __init__ (self): Parent . __init__ (self)
Reply content:For your question, the answer is yes, and there is no difference. But I don't feel good enough to answer the question.
To talk about super, first we should ignore the interference of the name "Super".
don't talk about super when you think of the parent
outercls.innercls ();
}
}
Class outercls{
public static Class innercls{
Innercls () {
System.out.println ("Innercls");
}
}
}
The output will be as you expect.
Innercls
Same as the ordinary class. For other uses of internal classes, refer to the relevant chapters in the "I" Java, which are not detailed here.
Second, this super
In the previous section, we discussed the various uses of static, by defining a method or member with static,
Intel has recently been exerting its power at the channel end, and the computer stores, 3C stores and the manufacturers of the manufacturers have been pushing the pole. However, in the face of "super extreme" this jerky vocabulary, a large number of users do not understand their meaning. Many consumers think "ultra-extreme" means super lightweight and super perfo
Repair of super block damage of ext3 File System-Linux general technology-Linux technology and application information. The following is a detailed description. # Mount/dev/sde1/foo
Mount: wrong fs type, bad option, bad superblock on/dev/sde1,
Or too mounted file systems
. How can this problem be solved?
Answer:
This error message indicates that the super block of the ext3 File System on the/dev/sde1 devi
, giving the member variable name an initial value of "John/mary Doe".In the constructor, if you want to use the keyword this, then it must be placed in the first row, and if not, it will cause a compilation errorThe use of "super"Constructors and methods use the keyword super to point to a superclass, but in a different way. Method with thisKeyword to execute methods in the overloaded superclass. Look at t
Super piano
[Problem description]
Little Z is a famous pianist. Recently, Dr. C gave little Z a super piano. Little Z hopes to use it to create the most wonderful music in the world.
This super piano can play n notes numbered 1 to n. The beauty of the I-th note is Ai, where AI can be positive or negative.
A "superchord" is composed of several consecutive numbered
~~
Class person {private string name; private int age; // No-argument constructor of the parent class public person () {system. out. println ("========= constructor in the parent class ========");} // getter and setter Methods Public String getname () {return this. name;} public void setname (string name) {This. name = Name;} public int getage () {return this. age;} public void setage (INT age) {This. age = age;} // return information method Public String getinfo () {return "name:" + name + ",
The definition of an object method in Python is bizarre, and the first parameter is generally named self (equivalent to this in other languages), which is used to pass the object itself, and it is not explicitly passed when called, and the system is automatically passed.
Today we introduce the protagonist is super (), in the inheritance of the class super () is very common, it solves the subclass calls the
The definition of an object method in Python is bizarre, and the first parameter is generally named self (equivalent to this in other languages), which is used to pass the object itself, and it is not explicitly passed when called, and the system is automatically passed.
Today we introduce the protagonist is super (), in the inheritance of the class super () is very common, it solves the subclass calls the
See link in the original: http://http//bubblexc.com/y2011/310/slightly revised.Straight, flatBefore talking about the super plane, let's talk about the straight line and the surface in Rn space.A point p and a nonnegative vector vin the given Rn space? Meet i=TV? +PThe set of point I is called a straight line in Rn space.T in the above formula is a scalar, vector v? Determines the direction of the line. 1 is shown below:Fig. 1:line Figu
Jump out of the super-IP of the solid-state range, seize a core, that is, the story changed, the scene changed, but the character is unchanged, the spirit of the world unchanged, the original world view unchanged.650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/77/00/wKioL1Zg5A_ScNWRAACjUslKjtE449.jpg "title=" 502ed15c053a3d8_size40_w776_h430.jpg "alt=" Wkiol1zg5a_scnwraacjuslkjte449.jpg "/>Wen/Zhang ShulePublished in "Zhuzhou daily" Novembe
Super-diamond
Configuration management system to provide system parameters configuration management, such as database configuration information, configuration parameters can be pushed to the client in real time (based on Netty4), to facilitate the system to dynamically modify the operating parameters.
Multiple projects can be built, each of which is divided into three profiles (development, test, production) to control profile level permi
Introduction: I always thought that the super of OC is the same as the super in Java. I didn't go into its essence until I encountered a situation that could not be explained according to my understanding at work. Analysis:Before that, read the following code:There are two classes: superclass subclass. Subclass inherits superclass and superclass inherits nsobject. @ implementation subclass -( id ) i
with this.Superuse super in the Java class to refer to the composition of the parent class, use this to refer to the current object , and if a class inherits from another class, when we new the instance object of the subclass, there will be a parent class object inside the subclass object. How do you refer to the parent object inside? Using Super to refer to, this refers to a reference to the current objec
statements below does not perform the A This. Age =Age ; - print (); - } the - PublicJavantiger (intAgeinthight) { - This(age);//Call yourself the second constructor, the number of two statements below does not execute the - This. hight =hight; + print (); - } + A Public voidPrint () {//Print function atSystem.out.println ("I am a" + Age + "years" + hight + "ruler Gao Tiger!"); - } - Public Static voidMain (string[] args) { - NewJa
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service