=NewExternalclass (); Externalclass.innerclass Inner= extern.NewInnerclass (); Inner.output (The field of the method); }}classexternalclass{PrivateString s = "outer class field"; classinnerclass{PrivateString s = "Inner class field"; Public voidOutPut (String s) {System.out.println (The value of "s" is "+s); System.out.println (The value of "THIS.S" + This. s); System.out.println (The value of "EXTERNALCLASS.S" is "+ Externalclass". This. s); } } }View CodeOutput Result:The value of S is
public class Basetypeclasstest {/** Common class* 1, the basic type of encapsulation class: In the Java language, eight basic types correspond to a wrapper class.** Byte ====>>> byte* Short ===>>> Short* int =====>>> Integer* Long ====>>> Long** Float ===>>> Float* Double ===>> Double** Char ====>>> Character* Boolean ==>> Boolean** 2, in the Java language, for the basic type of data to provide the appropri
class to execute the extension function and the original class method.Compare the classes that are generated after the original class and the dynamic proxy:1, $Proxy 0 accesses the real class object through the Invocationhandler implementation class call.2, dynamic Proxy extension is not included in $proxy0, but rather callback Invocationhandler interface, implement invoke method extension through subclass.Before and after using dynamic proxies from
1. generalization (generalization) As I understand, generalization is the way that subclasses inherit the parent class, and they can extend their capabilitiesEg:extend Implements2. dependence (Dependency) For two relatively independent objects, when one object is responsible for constructing an instance of another object, or a service that relies on another object, the two objects are primarily dependent.As: local variables, parameters of methods, or calls to static methodsEg: you need a boat t
[Java] Solr video tutorial and solr video tutorial for enterprise distributed search platform
Course BackgroundDistributed search engines that are highly available, scalable, and fault-tolerant. Solr is a high-performance full-text search server developed by Java 5 based on Lucene. At the same time, it i
In the previous article, we introduced how to manipulate the java byte code, and mentioned how to use the Java class loader to load the modified byte code and execute it on the JVM. Next, I will discuss the loading, linking, and initialization of Java classes. Java byte code
In the absence of a good study of object-oriented
Design
Before the design pattern, I had a vague understanding of Java interfaces and Java Abstract classes.
When I first learned the Java language, it was hard to understand why the concept of interfaces was required. Although multi-inheritance can be imple
JAVA basics/Lesson 6: Object-oriented/JAVA classes and objects, Object-Oriented java
2013-0
I. process-oriented and object-oriented
1. process-oriented programming: Starting from every step of solving the problem, it is suitable for solving small and simple problems. Program = Algorithm + data.
2. object-Oriented Progr
JAVA basics/Lesson 24th: What does THIS mean in classes and objects/JAVA? Passing parameter xiangjie and java xiangjie
1. the keyword "this" is equivalent to "I" in Mandarin, for example:
When James says "I have eaten", "I" represents JamesWhen Xiaohong says "I have eaten", "I" represents Xiaohong."I" represents the c
JAVA basics/Lesson 22nd: classes and objects/What are references in JAVA? Inherit ?, Java inheritance
1. The concept of reference. If a variable is of the class type rather than the basic type, this variable is also called a reference.
1. Reference and point:
new Hero();
Creates a Hero object.But it only creates an ob
Java language-Analysis of Internal classes in Java-general Linux technology-Linux programming and kernel information. The following is a detailed description. Many people may not be familiar with the Inner Class mentioned in Java. In fact, similar concepts also exist in C ++, that is, Nested Class ), the differences an
JAVA source code for mobile video calls and java source code for calls
I recently learned how to develop cross-platform audio and video communication on the Android platform. Although there are many open-source projects on the Internet for our reference, the audio and video
Classes and objects in Java programming, Java programming objects
As we all know about computers, the current computer programming language is mainly divided into two major parts: process-oriented and object-oriented. Java is a pure object-oriented language. After learning Java
Java basics 2: abstract classes, interfaces and polymorphism, java Polymorphism
I think I can write well on the basics of Java. I used to post it on my other blog. It must be original. I will share it with you now.
Zookeeper ---------------------------------------------------------------------------------------------
Java basics-abstract classes, interfaces and polymorphism, java Polymorphism
Abstract classes, interfaces, and polymorphism are basic objects. I believe that people who can see this blog will not be entangled in its basic definition, this article will try to explore its connotation at a deeper level, hoping to help you
Java learning notes-nested classes and java learning notes nestingNested class
There are two types of Nested classes: static and non-static, which correspond to static Nested classes and internal classes respectively.
1 class Oute
Many people may not be familiar with the Inner Class mentioned in Java. In fact, similar concepts also exist in C ++, that is, Nested Class ), the differences and connections between the two are compared in the following section. On the surface, the internal class defines another class in the class (as we can see below, the internal class can be defined in many places), but it is actually not that simple, at first glance, the internal class seems redu
Talking about java internal classes, talking about java
1. What is an internal class?
What is an internal class? In layman's terms, it refers to the class defined inside the class, including the class defined in the method, method, or code block of a class.
2. Why use internal classes?
Why are we not going to take 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.