Both "Thinking in Java" and "Core Java" are classic books in Java. It's also a lot of the two books that have just come in contact with Java. Recently, the two books have been properly turned over again.
Core
variables will reference the same array. The copy here is implemented with the assignment symbol =.10.4 Array SortingWhen you need to sort a numeric array, you can apply the sort method in the arrays class.10.5 Multi-dimensional arraysMultidimensional arrays use multiple subscripts to access array elements, which are useful for representing tables or more complex permutations. For example, declaring a two-dimensional array
Double[][] A;
Again, it is not available before initializa
classes and packages:java -ea:... -da:MyClass MyAppYou cannot apply a system class that does not have a classloader, to use:-enablesystemassertions/-esaUsing assertions to complete parameter checkingUse the assertion scenario:
Assertion failure is a fatal, unrecoverable error
Assertions for development and test phases
Non-notification of recoverability errors should not be used as a means of informing users of problems.This method is not allowed to be called with a null array,
Java terminology
Term name
Abbreviation
Explain
Java Development Kit
Jdk
Software used by programmers who write programs
Java Runtime enviroment
Jre
Software used by users running Java programs
Server JRE
Software that runs
Java memory allocation and management is one of the core technologies of Java. We have previously introduced Java memory management and Memory leakage and Java garbage collection knowledge. Today we go deep into Java
, in the programming language, threading can be a love-hate paradox for programmers, which can greatly simplify the model, help programmers write powerful code, and, on the other hand, make our programs appear with a variety of bugs that can be difficult to reproduce in the development environment.
Here the author based on the "Java Core technology" book and some Bovinlai to share with you on
To prepare to learn the next Java, according to the "core Java" content, simply made a note. There are many places in this book that compare the syntax of C + + and Java, so it's very advantageous for those who turn from C + + to Java!Javac Xxx.javajava XXXJava Applet:applet
, it can be embedded, based on the class set that is currently loaded. If necessary, you can also undo the optimization.Multithreading : Multithreading brings better interactive response and real-time behavior. Multithreaded compilation is simple.Dynamic : Dynamic is important when some code is added to a running program. The current version of Java allows programmers to know the structure and behavior of objects. It is useful for systems that must pa
execution path; the so-called execution path refers to the directory list where the operating system searches for a local executable file.The same level directory in Jdk\bin contains the Src.zip file, which is the source code for all public classesGet more source code (compilers, virtual machines, local methods, and private helper classes, etc.) with access to: Oracle.net.Here is the anatomy of the JDK section:The difference between the JDK and the JRE can be seen clearly:There are three types
= Point.class;System.out.println (C3.getname ())//PointEach object in the class generates a Class object in the virtual machine to hold the information for each class, which can be obtained to obtain all the information about the class.A virtual machine manages a class object for each type,You can compare two classes of objects with = = (E.getclass () = = Employee.class) ...You can also reflect the created object E.getclass () After you get the instance. newinstance ();Newinstance () will tune
[Java Study Notes] Chapter 5 inheritance of Java core technologiesChapter 2 Inheritance
Using inheritance, You can construct a new class based on an existing class. Inheriting existing classes is to reuse (inherit) the methods and domains of these classes. You can also add new methods and domains.
Reflection.5.1 superclass subclass
Use extends to construct a deri
[Java Study Notes] Chapter 4 of Java core technologies
Chapter 5 basic concepts of objects and classes 4th and objects
Describes the basic concepts of classes and objects and the relationship between classes.
Many objects in the program come from the standard library and some custom objects.
Structured Program Design: design a series of processes (algorithms) an
"Original" https://www.toutiao.com/i6594587397101453827/Java Core Data structure (List,map,set) usage tips and optimizationsJDK provides a set of major data structure implementations, such as list, MAP, set and other common data structures. This data is inherited from the Java.util.Collection interface and is located in the Java.util package. 1. List interface The three most important list interface impleme
uses an optimized fast sorting algorithm.10.6 Two-dimensional arraysMultidimensional arrays use multiple subscripts to access array elements, which are suitable for representing tables or more complex permutations.To traverse a two-dimensional array:for (int i=0;i{for (int j=0;j{ ... }}The For Each loop statement does not automatically process each element of a two-dimensional array, requiring the use of two nested loopsTo quickly print a list of data elements for a two-dimensional array, you
called and passed to it with the methods object and the original invocation parameters. The calling processor must give a way to call processing.To create a proxy object, you need to use the Newproxyinstance method of the proxy class, which has three parameters:1: Class loader. As part of the Java security model, for system classes and from other classes, you can use a different classloader, currently using the default class loader with null notation
Observer observer the message and the event is one, the difference is that when inheriting Java codeChanges in different ways.The triggers in the database are somewhat like this, but they are not generally compared.Similar to the Django views.py, how does the Web. XML modify the code so that it can map URLs to the actual file address?Set Jsp-file-servlet-name, Url-pattern- servlet-name, to get Url-pattern to jsp-file mappings.I want to change the Web
java MyProg >log.txt
5) The processor that can change non-default catch exception
Thread.setDefaultUncaughtExceptionHandler{
new Thread.UncaughtExceptionHandler(){
public void uncaughtException(Thread t, Throwable e){
//save info to file
}
}
}
6) If you want to see the class loading process, you can invoke the-verbose flag to start the Java
not recommend not knowing when to callPackage import with ingest package is similar to reference namespacePackage = = NamespaceImport = = usingStatic ImportClass Design Tips1) Guaranteed Data privacy2) Initialize the data3) Do not use the base type too much in the class (you can use the aggregation relationship instead)4) Not all domains require separate accessors and converters5) Decomposition of classes with excessive responsibilities6) The class name and method name should be able to reflect
. Cannot instantiate a type variable, cannot construct a generic arrayCannot be new T (...), new t[] or t.class, because when the type is erased, T becomes the object typeor Object[2],new object () is not what we want to see, you can use reflection to create an objectFirst. T.class is not legal.public static {try{return new Pair}catch (Exception ex){return null}}Pair6. Invalid type variable in static context of generic classCannot reference a type variable in a static field or methodpublic class
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.