Java Learning--basic knowledge Advanced day--notes

Source: Internet
Author: User

Standard input and output streams
Standard input stream: system.in, the default point is the keyboard
Standard output stream: System.out, the default point is the console

Change the default direction of the input and output stream
static void SetIn (InputStream in)
Reassign the "standard" input stream.
static void SetOut (PrintStream out)
Reassign the "standard" output stream.

Convert stream
OutputStreamWriter, character Stream, is a bridge of characters flowing to the stream of words
InputStreamReader, character Stream, is the bridge of byte flow to character stream

Print Flow
PrintStream: Byte stream, no auto refresh function
Print ()
println ()
Write ()
PrintWriter: Character stream, with auto refresh function
Print () + +
println ()
Write ()

Wrap Line
println ()
Auto Refresh
Automatic refresh must be on, and only valid for the three methods of println, printf, or format

Object Manipulation Flow
Function: For reading and writing objects

ObjectOutputStream: Writes an object to a file, serializes
* WriteObject (Object o)
ObjectInputStream: Reads the files in the object, deserializes them
* ReadObject ()

Properties
Hashtable and HashMap, StringBuffer and StringBuilder, vectors and ArrayList


Java Learning-Basic knowledge Advanced Day-notes

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.