Sun Java Naming Standard
• Classes and interfacesThe first letter should be capitalized. If the name is composed of multiple words, the first letter of each word should be capitalized.The class name should be represented by a noun. Example:
1:static keywords1) provides a separate space store for the shared data of the object.2) The modified method can be called directly by the class nameCons: 1) long life cycle.2) Access restrictions (only static access)It can have static methods,
features
A singleton class can have only one instance.
The Singleton class must create its own unique instance.
The Singleton class must provide this instance to all other objects.
Singleton mode ensures that a class has only
What is polymorphic1object-oriented three main features: encapsulation, inheritance, polymorphism. From a certain point of view, encapsulation and inheritance are almost always prepared for polymorphism. This is our last concept, but also the most
Final & StaticThe final class cannot be inherited, there are no subclasses, and the methods in the final class are final by default. The final method cannot be overridden by a method of a class, but can be inherited. The final member variable
A review of the basics of Java.1, inheritance: By using the keyword extends, subclasses can inherit all the methods and properties of the parent class, but cannot use private (private) methods and properties, only one parent class at a time.2.
1. Static methodsIn general, defining a method in a class is static, which means that you do not need an object of this class to call this methodThe method declared as static has the following limitations:· They can only invoke other static methods.·
Three main features of Java object-oriented: encapsulation, inheritance, and polymorphism. Classes and objects
All classes are reference data types. For a class definition, there are three most common members: constructors, properties,
What is the most important feature of Java?
Java is a platform independent language.
What do you mean by platform independence?
Platform independence means that we can write and compile the java code in one platform (e. g windows) and can
JAVA interface and abstract class, JAVA interface abstract class
For object-oriented programming, abstraction is one of its major features. In Java, OOP abstraction can be embodied in two forms: interfaces and abstract classes.
I. abstract class
If
2. Functions and arrays, 2. Function Arrays
I. Functions
1. Definition:
Modifier Return Value Type Function Name (parameter type parameter 1, parameter type parameter 2 ......) {
Execute the statement;
Return value;
}
Modifier: There are many
Interface (Interface)
is a collection of abstract methods , and interfaces are usually declared with interface.
A class inherits the abstract method of an interface by inheriting the interface.interfaces are not classes , and the way
@Kroll.proxy
public class MyProxy extends KrollProxy {
@Kroll.method(runOnUiThread=true)
public int doSomething() {
return 100;
}
}
Official Address: Android Module Development Guide
Summary
This guide
Static represents the meaning of "global" or "static", which modifies member variables and member methods, and can also form statically static blocks of code, but there is no concept of global variables in the Java language.member variables and
Xi. Packing Class (Integer)A) Common methods:I. Integer.max_value ();//Gets the maximum value of intII. Integer.min_value ();//Gets the minimum value of intIii. tobinarystring ()//Turn binaryIv. tohexstrng ()//Turn hex12. Abstract classA)
Single Case design modeSingleton is a pattern of creation in which a class takes Singleton mode, and when the class is created, it is possible to produce only one instance for external access and a global access point.The core points of knowledge
1. The style must be consistency (consistent)A fellow man with my nose asked, why does our Java code indentation format have to be this way, but not him, he is like his own, so he wrote the code is always in his own custom style. The results were
Link Address: http://www.cnblogs.com/devinzhang/archive/2011/12/13/2286367.htmlStatic represents the meaning of "global" or "static", which modifies member variables and member methods, and can also form statically static blocks of code, but there
Although I learned the java language from my sophomore year and later I learned more about the android program, I was asked some questions about the basic design knowledge like this during several interviews, at ordinary times, programming does not
There are three main things to use in Java Keywords: data, methods, classes.Final data:We need to keep the data constant when we need a value that will never change and that is not expected to change when the runtime is initialized.For a
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.