Note: class is a Java keyword that is used when declaring a Java class;
Instances of class classes represent Java Application Runtime classes (class ans enum) or interfaces (in
Encapsulation: is to encapsulate some attributes and methods into a class.
Inheritance: Just as subclasses inherit some of the properties and methods of the parent class.
Polymorphism: Just as a parent class has several distinct subclasses.
Here I do not explain more, the following I mainly explain an inheritance. Inheritance is a feature of OOP (object-oriented)
. The behavior of this convenient method is the same as that of C.addall (arrays.aslist (elements)) ,But in most implementations, this method can be much faster to run.import Java.util.arraylist;import java.util.arrays;import java.util.List; Public classCollectionsTest2 { Public Static voidMain (string[] args) {string[] str={"Hello","Nihao","say"," Love"}; Listarrays.aslist (str); ArrayList List2=NewArrayList (); List2.addall (List1); System. out. println (LIST2); }} Like on the point
Class Name Object name =new class name ();Class Name Object name This explanation is to create a class name class reference variable named "Object name"New; The explanation for this is the instantiation of the objectThe explanation of the
Command1.java file converted to class file: Javac-source 1.6-target 1.6 X.java (X.java is the file to be converted, the default is to generate a class file of the same name)Such as:
D:\java\studio\sdk\build-tools\22.0.1>javac-source 1.6-target 1.6 com/chaos/ha
Ck/AntiLazyLoad.java
2.
[Common Java class libraries] _ date operation class (date, calendar AR) Notes
Objectives of this chapter:
Understanding how to use the date classYou can use the calendar class to obtain the complete date:
The date class is a commonly used
1 keyword thisThe implicit parameter (Page 106,java core Technology), which represents the current class, is used internally within the class definition, distinguishing member variables and local variables with the This member variable name .2 class variable (static variable)--static identifierThe method of a static va
Common tool classes in Java string and MD5 encryption decryption class
We Java programmers in the development of projects are often used in a number of tool classes. Today I share my two tool classes that you can use in your project.
One, String tool class
Package com.itjh.javaUtil;
Import Java.io.ByteArrayInput
Schematic diagram of Java Virtual Machine 1.4 field table set in the class file -- how the field is organized in the class file, graphic tutorial on Virtual Machine networking0. Preface
Understanding the principles of JVM virtual machines is the only way for every Java programmer to practice. However, the JVM virtual m
Overview and methods of the date class are used* Overview of the A:date class* Class Date represents a specific moment, accurate to milliseconds.* B: Construction method* Public Date ()* Public date (long date)* C: Member method* Public long GetTime ()* public void SetTime (long time)DateFormat class* Overview of the A
Static internal abstract classes can be inherited.public class Testfather {public static void Main (string[] args) {Person.talk2 a = new Newtalk ();A.get ();Person Person1 = new Student ("Alice", 20, "female");System.out.println (Person1.talk ());/* Person Person2 = new person (); *///abstract class cannot be called}}Abstract class Person {String name;int age;Str
1. Abstract classes cannot be instantiated.2. Abstract classes can have constructors, which are inherited when the subclass must inherit a constructor of the parent class, and the abstract method cannot be declared static.3. Abstract methods only need to declare, without implementation, the abstract class can allow the normal method has the principal4. Classes that contain abstract methods must be declared
Common Java class libraries-Observer design patterns (Observable class Observer Interface) and observableobserver
Link: http://www.2cto.com/kf/201310/253013.html
To implement the Observer mode, you must rely on the Observable class and Observer interface provided in the java
Static load Class in Java is the compile time load class dynamic load class refers to the runtime load classWhat's the difference?As an example, I now create a class implementation function that assumes that specific classes and methods are called through the arguments passe
Java String Class (Java.lang.String) is the most used class in Java, and is also the most special class, and many times we are both familiar and unfamiliar with it.
A fundamental understanding of the Java.lang.String class and st
1, Java Operation
Test jar: Execute---java-classpath f:/testhello.jar Test2
Or
JAVA-CP F:/testhello.jar Test2
Print Results: Hello World
The Java classes are as follows:
/**
* Document: This kind of function----> Print Hello World
* USER:YANGJF
* date:2016/9/25 9:48
/Public
In the previous blog we mentioned ClassLoader, knowing that ClassLoader was used to dynamically load a class file into memory, but how did this class file be generated? Where did it come from? This in turn involves another conceptual-java.lang.class.Class is a special class for Java, which is an abstract
parent class is private, and the subclass cannot have it, salute![Java]View PlainCopy
Public class Helloa {
public static void Main (string[] args) {
new B (). print ();
}
}
[Java]View PlainCopy
classb extendsa{
private Strings= "B" NBSP;;NBSP;NBSP;
publicvoidp
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.