Exception Handling Mode 2
Throw up throw upPackage cn.seven.shengsiyuan.exception;/* * April 05, 2015 13:05:35 * location:501 * Exception handling Method 2: Throws an exception, by the method that calls the method Handle the exception
Sort out some of the common methods of HashMap according to Java1.6 's API.1.sizepublic int size ();Returns the number of key-value mapping relationships in this map2.isEmptypublic boolean isEmpty ()Determine if this map does not contain a key-value
In Java, variables are divided into the following two classes,1, for the basic type of variable, Java is a copy of the value, the instant its own copy has changed, and will not change itself.2, for all object-type variables, Java is a copy of the
Behavior of the objectMethod Call StackAll methods are maintained in a structure called the call stack, and the currently executing method is located in the call stack.For a basic type of variable: the Java Virtual machine puts it on the stack.For a
1. The inner class is a compiler phenomenon that is independent of the virtual machine. The compiler will translate the inner class into a regular file that separates the external class name from the inner class, and the virtual machine knows
meaning of the volatile keyword in JavaIn Java thread concurrency processing, there is a very big confusion about the use of a keyword volatile, for the use of this keyword, in the multi-threaded concurrent processing can be all right.The Java
Userdao interface/ * * Userdao interface * / Public InterfaceUserdao {//Insert User Public void Insert(user user);//delete user Public void Delete(intID);//Update users Public void Update(user user);//Query All users
Brief introductionSummarize how final and static are used in JavaI. FinalDepending on the context of the program, the Java keyword final has the meaning of "cannot be changed" or "End state", which can be used to modify non-abstract classes,
Several of the main most common memory allocation rules:??1. Object Precedence in Eden assignment?In most cases, objects are allocated in the new generation of Eden . ??When the Eden area does not have enough space to allocate, the virtual will
A thread is a single sequential control flow in a program. A relatively independent, scheduled execution unit within a process is the unit of dispatch for the system to dispatch and dispatch CPUs independently of the operating program. Running
In the book "Java and Patterns" of Dr. Shanhong, this describes the adapter (Adapter) Pattern:The adapter mode transforms the interface of one class into another interface that the client expects, so that two classes that would otherwise not work
1. An inner class is a class that is defined in another class.Cause: A. An internal class method can access data in the scope where the class definition resides, including private data.B. Inner classes can be hidden from other classes in the same
Brief introductionThe motivation for generics to occur is: In order to create a container classGeneric classThe container class should be one of the most reusable class libraries. Let's take a look at how a container class is defined without a
1. Strong referencesUsually when we program, for example: Object Object=new object (); That object is a strong reference. If an object has a strong reference, it is similar to essential necessities, and the garbage collector will never recycle it.
Semaphore
Achieve a typical signal volume
Countdownlatch
Waits until a specified number of events have occurred
Cyclicbarrier
To allow a group of threads to wait at a predefined execution point
Java design mode -- factory method)
The factory method mode is the class creation mode. It is intended to define a factory interface for creating product objects and postpone the actual creation to the subclass.I believe that many people have done
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