Here are some of the more advanced questions that are rarely asked in interviews because they may shut out the interviewer. But you can find yourself some time to practice.
1. System.exit (0) skips the execution of the finally block
System.
One, reflection in Java
1. Load class properties and method instance code by reflection:
/** * Java.lang.Class is the source of reflection * We created a class that generates the corresponding class file by compiling (Javac.exe), after which
Copy Code code as follows:
Import java.util.ArrayList;
Import java.util.List;
public class Test2 {
/**
* @param args
*/
public static void Main (string[] args) {
String src = "A b c D E b C";
Replace space
src = Src.replaceall ("", "");
This article for everyone to share is the commonly used date comparison method, for future reference.
Warm-up: get current time
SimpleDateFormat df = new SimpleDateFormat ("Yyyy-mm-dd HH:mm:ss");//Set Date formatString nowdate = Df.format (new
The reason why an exception is a powerful debugging tool is that it answers the following three questions:
1, what went wrong?
2, where is the fault?
3, why the error?
In cases where an exception is used effectively, the exception type answers
First, the use of object.tostring ()The ToString method is a public method of the Java.lang.Object object. Any object in Java inherits the object, so it is generally possible for any object to invoke the method of ToString. This is the way in which
The technical background of the thread pool
In object-oriented programming, it is time-consuming to create and destroy objects because creating an object takes up memory resources or other additional resources. This is especially true in Java,
1. How to have no locks in concurrency.A very simple idea to convert concurrency into a single thread. The disruptor of Java is a good example. If you use Java Concurrentcollection class to do, the principle is to start a thread, run a queue,
The first one discusses object-oriented programming and its features, common questions about Java and its functionality, Java collection classes, garbage collectors, this chapter focuses on exception handling, Java applets, SWING,JDBC, remote method
1. Several important concepts about high concurrency
1.1 Synchronous and asynchronous
First of all, synchronous and asynchronous refers to the function/method invocation aspect.
Obviously, the synchronous call waits for the return of the method,
One, two main problems in network programming
One is how to accurately locate the network on one or more hosts, and the other is to find the host after the reliable and efficient data transmission.
In the TCP/IP protocol, the IP layer is mainly
General inquiries about the contents of the cell phone should be very easy to save the JSON format, found Taobao's home to the Internet API, and the processing of JSON-related jar bag, do the phone attribution to the query function
Copy Code
What are the deficiencies or questions I would like to be able to get a lot of corrections, thank you
Copy Code code as follows:
Import Java.util.Scanner;
/**** @author CC Example 100 coins, initially all facing down, the first time
Introduction:
About Java IO flow is very common, basically every project will be used, each encounter is to find a search on the internet, and tried. Last time a colleague asked me to read a Java file, I suddenly Meng the first reaction is to go
This chapter covers the following topics:1. Sleep () Introduction2. Sleep () example3. Comparison of sleep () and wait ()
1. Sleep () IntroductionSleep () is defined in Thread.java.The function of sleep () is to let the current thread hibernate,
About the thread pool content, we will detail in the future, now, the first thread and runnable to understand. The contents of this chapter include:Introduction to Thread and runnableSimilarities and differences of thread and runnableThread and
Multithreading is an unavoidable important subject in Java. Below we will expand the study of multithreading. The next step is to explain the Java multithreaded content before the "new Juc package in JDK", which includes interfaces such as Wait (),
final VariableIf the final keyword is added before a variable, the variable cannot be changed once it is initialized.
If a final variable is a class member variable, it must be initialized and can only be initialized once.
The parameter in the
Here is a small example to verify the error capture.
Copy Code code as follows:
public class Testcatcherror extends error{
Private static final long serialversionuid = -351488225420878020l;
Public Testcatcherror () {Super
This example for you to share the Java streaming layout graphical interface code for your reference, the specific content as follows
Package Jisuanqi;
Import java.awt.*;
public class MyFrame extends frame{
//Inherit Frame class public
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