Work on the first day 2019-7-22

Simply record what problems encountered in the first day of school:

Download jdk, lower than the required login Oracle jdk1.8.


Java Enum knowledge about the enumeration.


About Collections HashMap, a collection of related knowledge about Java lot worse.


java.util.ArrayList<E>

From the point of view various code book, java.util.ArrayList <E> is a very important class widely used in the code, E represents a generic, the ArrayList is a generic class. ArrayList equivalent to the C ++ vector, for storing objects. Unlike arrays, arrays once created, fixed length, but the length ArrayList is dynamic, is not limited, many objects can be stored, but only storage object can not be stored, for example, native data types int. That dynamic when removed first (0) element, a second (1) becomes the first element.


BufferedReader class to read the character from the input stream and buffered characters for efficient reading of characters, arrays, and lines

You can specify the size of the buffer size may be used by default constructor. For most purposes, the default value is large enough

Reader constituted by each of the read requests will lead to a corresponding read request composed of a byte stream or a character basis, the adoption of the packaging Reader BufferedReader class instances to improve efficiency, such as

BufferedReader in = new BufferedReader (new FileReader ( "foo.in")); DataInputStreams using the text input application can be localized by replacing each DataInputStream with an appropriate BufferedReader


String of indexof () method:

substring () returns the contents of the string to a position before the second character parameter

  1 package com.inspur.demo;
  2 
  3 import threeday.Manager;
  4 
  5 public class Test {
  6 
  7 	public static void main(String[] args) {
  8 		//System.out.println(System.getProperty("file.encoding"));
  9 		String s = "lixiaoxu";
 10 		System.out.println(s.indexOf("i"));
 11 		System.out.println(s.substring(0, 2));
 12 	}
 13 }
 14 
result:

1


Understanding Regular Expressions

Regular expression \ s match any whitespace characters, including spaces, tabs, page breaks, etc., is equivalent to [\ f \ n \ r \ t \ v]

\f -> 匹配一个换页
\n -> 匹配一个换行符
\r -> 匹配一个回车符
\t -> 匹配一个制表符
\v -> 匹配一个垂直制表符
而“\s+”则表示匹配任意多个上面的字符。另因为反斜杠在Java里是转义字符,所以在Java里,我们要这么用“\\s+”


Java replaceAll() 方法


了解通信相关知识,可以看《大话通信》。










Guess you like

Origin www.cnblogs.com/lixiaoxu/p/11227521.html