Properties class:
A subclass of hashtable. The main function is to operate attributes as a configuration file.
Features: saved in the form of "Key = value". The stored content is string and annotated #.
The methods for loading properties files
Queue interface:
Inherited from collection Interface
FIFO
Common Methods:
Offer () inserts elements at the end of the Team for cross-border checks
Peek () obtains the element of the queue header. The check is not empty.
Poll () gets and
Memory stream:
Memory input stream: Memory --->ProgramBytearrayinputstream and chararrayreader
Memory output stream: Program ---> memoryBytearrayoutputstream, chararraywriter
The memory stream does not need to be closed. The read operations
Features of list:
(1) List has an ordered set, and each element in the SET has a corresponding sequence.
(2) duplicate elements can be used in the list set and corresponding elements can be accessed through indexes.
Import Java. util. arraylist;
Exercise: Use stringbuilder or stringbuffer:Convert the string "ABCDE" into the string "a, B, c, d"
Public class stringbuildertest {public static void main (string [] ARGs) {stringbuilder sb = new stringbuilder ("ABCDE"); system. out. println
Http://acm.hdu.edu.cn/contests/contest_showproblem.php? PID = 1001 & cid = 439
Java is really good and powerful. As long as the Java foundation is better, such a question is simple.
Note that the month and date of the calendar class are not
Package Mediator. MyTest; // rent an abstract class lodger {int maxmoney; int minmoney; String name; public abstract void rented (); public abstract void statisticsHouse ();}
Package Mediator. MyTest; // The landlord abstract class landlord {int
Package ParttenDesign; // Command interface of the general public interface Command {void defend (); void attack ();}
The command action the General wants the soldiers to send
Package ParttenDesign; public class Commander implements Command
Import java. util .*;
Class InsertSort
{
ArrayList al;
Public InsertSort (int num, int mod)
{
Al = new ArrayList (num );
Random rand = new Random ();
System. out. println ("The ArrayList Sort Before :");
For (int I = 0; I {
Al. add (new Integer
Openreports click count: 7596
OpenReports provides a web-based flexible report solution that automatically generates dynamic PDF, XLS, HTMLCSV, and Chart reports in a browser. The open-source technologies used include Hibernate, Veloctiy, and
Thread communication C-P exercise: the bucket stores "name, gender" type of data, the producer is responsible for putting data to the bucket, the consumer is responsible for getting data from the bucket. Program to realize the C-P relationship. And
Why use a set?
Object-oriented language (OSS) Stores objects to facilitate operations on multiple objects. A set of objects is the most common method for storing objects.
Collection class features:A set is only used to store objects. The length of a
Hashtable: it is rarely used and has been replaced by HashMap. The only note is that the Properties class is its subclass.
HashMap: The thread is unsafe and fast. It allows storing Null keys, Null values, and unordered storage. It is recommended
This section briefly describes the hierarchical design concept in Java. As shown in:
The function implementation is divided into two layers: the access layer and the business layer.
(1) design the IDao Interface
package web.java.xml.model;public
According to the original, let's test the output results of the following program without running it. (Please note that this is about polymorphism)
Package acm; // Example 1 class Test extends Main {private void write () {System. out. println
First, take a look at a piece of code to test everyone. Please output the following code results without running the program:
class Insect {int i = 9;int j;Insect() {prt("i = " + i + ", j = " + j);j = 39;}static int x1 = prt("static Insect.x1
The first time I saw Fang Shen use an object stream to store information that has already been executed, I feel that this operation is really amazing. Through the object stream, I can save dynamic objects.
For example, if half of the clearance
Array Initialization
Method 1:
Int a [];
A = new int [10];
Method 2:
Int a [] = new int [10];
Method 3:
Int a [] = {1, 2, 3, 4, 5 };
Use of two functions
Function 1: System. arraycopy Function
Public static void main (String args []) {int [] a, B;
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