View on GitHub

reading-notes

Read: 03 - Maps, primitives, File I/O

Pirmitives Vs Objects

Primitive is a basic data Type like:

object is a basic data type like:

and the defaults is Null.

File

File path have three parts:

File systems are composed of three main parts:

Exception : An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program’s instructions.

The Catch or Specify Requirement :

The Three Kinds of Exceptions

  1. The first kind of exception is the checked exception.
  2. The second kind of exception is the error.
  3. The third kind of exception is the runtime exception.

How to Throw Exceptions
the Java platform provides numerous exception classes. All the classes are descendants of the Throwable class, and all allow programs to differentiate among the various types of exceptions that can occur during the execution of a program.
You can also create your own exception classes to represent problems that can occur within the classes you write.
All methods use the throw statement to throw an exception. The throw statement requires a single argument: a throwable object. Throwable objects are instances of any subclass of the Throwable class. Here’s an example of a throw statement.

throw someThrowableObject;

Assertion : An assertion is a sanity-check that you can turn on or turn off when you are done with your testing of the program.

Scanning

Objects of type Scanner are useful for breaking down formatted input into tokens and translating individual tokens according to their data type.
a scanner uses white space to separate tokens. (White space characters include blanks, tabs, and line terminators. For the full list, refer to the documentation for Character.isWhitespace.)