Java Learning Summary (i)

1. Overview 1.1 DOS command line-common commandsL dir: Lists the files and folders in the current directoryL MD: Create directoryL RD: Delete directoryL CD: Enter the specified directoryL CD. : Back to the top level directoryL cd/: Go back to the

A simple example of java-threadlocal

content: ThreadLocal: allows us to create variables that can only be read and written by the same thread, such as a web app that moves a variable from the front to the background, and needs to always be available at any time in the thread of the

Snake Java applet

Class control code: import Java.awt.event.keyevent;import Java.awt.event.KeyListener; public class Control implements KeyListener {//monitor the keyboard Snakemodel snake=null;public Control (Snakemodel snake) {This.snak E=snake;} @Overridepublic

Java TCP Network Programming Simple example

Start the Server side and enter a dead loop to listen to a port for connection requests. Then run the client side, the clients make a connection request, the service side to listen to the request after the client sent back to accept the message, the

Java final domain

1 Public Final classThreestooges {2 3 4 /*5 * Stooges is a reference to the Set type, and final qualifies the reference member property stooges to be assigned an initial value and cannot be changed to refer to other similar objects6 *

Shallow copy and deep copy in Java

Shallow copy: Packagetest;classStudentImplementscloneable {Private intNumber ; Public intGetNumber () {returnNumber ; } Public voidSetnumber (intNumber ) { This. Number =Number ; } @Override PublicObject Clone () {Student stu=NULL;

Java syntax error-code that cannot be executed

In Java, it is not allowed to write code that cannot be executed, and such errors can be categorized in the following ways: ReturnThe statement after return is treated as invalid code. ThrowThe code after throwing an exception directly with

Java notes--Enumerations & annotations

1, the implementation of the custom enumeration class, for example:classseason{//1, provides the properties of the class, declared as Rivate final Private FinalString name; Private FinalString Desc; //2, property declared as final, initialized in

Methods for copying arrays in Java

In Java, you can use the copy statement "A=b" to pass values to the basic type of data, but if a and B are two arrays of the same type, copying is equivalent to passing a reference to an array variable to another array, and if an array changes,

Java Learning--Exception handling

使用 Java 语言进行软件开发和测试脚本开发时不容忽视的一个问题就是异常处。是否进行异常处理直接关系到开发出的软件的稳定性和健壮性。Abnormal Exception refers to the various conditions, such as: file cannot be found, network connection failure, illegal parameters and so on. An exception is an event that

How to quickly publish the WebService service in Java

In practice, have you ever experienced the need to publish webservice to someone else's call? If you are a novice in Java, the customer or partner is very tight, you certainly worry about it. Don't worry, let's see what tools or objects we can use

Java Singleton class

            Singleton class:Key points of knowledge:1, single class concept, characteristics2, three kinds of single-class lazy, a hungry man, double locking example,3, lazy, a hungry man differences and a summary of the Singleton class; 1, Concept:

Java-maven exception-cannot is cast to javax.servlet.Filter error, cause Servlet-api.jar conflict

Use MAVEN to develop a Web application that starts with an error:2.3 9.7. 2 class: Javax/servlet/servlet. classThen output the error:Severity: Exception starting filter EncodingFilterjava.lang.ClassCastException:

Java.lang.OutOfMemoryError Exception Resolution method

Cause: The following are common:1. The amount of data loaded in memory is too large, such as fetching too much data from the database at once;2. There are references to objects in the collection class that are not emptied after use, so that the JVM

Java Web application Request parameter encoding

We know that when the spelling to jump in the URL contains Chinese, generally need to transcode processing, to the server side to properly receive and processing, which is the client and server-side communication to the data format

File Save in Java, Open File dialog box

1 Package com.soft.test;2 3 //Awt:filedialog class + FilenameFilter class can implement this function4 //Swing:jfilechooser class + FileFilter class can implement this function5 //6 //This class is used to test open files and save files in the

Java abstract class

Abstract class:What is an abstract class?In object-oriented concepts, we know that all objects are depicted through classes , but not in the opposite way. Not all classes are used to depict objects, and if a class does not contain enough information

No default constructor for entity java no parameter constructor

Exception Org.hibernate.InstantiationException:No default constructor for entityThe entity class that is returned when the query is an object instance is the one that hibernate dynamically generates through reflection.The reflected Class.forName

Java for Leetcode 138 Copy List with Random Pointer

A linked list is given such this each node contains an additional random pointer which could point to all node in the list or null.Return a deep copy of the list.Problem Solving Ideas:We made a copy of the diagram in the Java for Leetcode 133 Clone

Notes on code cleansing: Comments

Notes on code cleansing: Comments Preface: I used to be convinced that "comments in a good code should take at least half of the size". I am also very proud to add javadoc to every function; I am sorry for the "bad habit" of writing code without

Total Pages: 6206 1 .... 1974 1975 1976 1977 1978 .... 6206 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.