[Java] Overview of Java
Java edition (environment)
-
JavaSE(Java Platform, StandardEdition)
-
Java SE provides a basic execution / development environment for running Java applications
-
General-purpose library for string / number, date manipulation, input / output processing, etc.
-
Basically only this is used
-
JavaEE(Java Platform, Enterprise Edition)
-
JavaEE is a library for developing server applications that run on this Java SE.
-
Functions mainly designed for corporate system development
-
JavaME(Java Platform, Micro Edition)
-
For embedding in resource-limited environments (mobile phones, home appliances, etc.)
-
Integrated into Java SE in the recent IoT trend
Java history
- After the editions were organized according to the environment in Java2 (version 1.2), the JDK came to be called J2SE (Java2 Platform, Standard Edition).
- In Ver6, the name J2SE will be changed to Java SE.
- Java 8 and 9 add modern features such as lambda expressions and modules
- Oracle JDK is paid for with Java 11 (OpenJDK is free)
- LTS is not provided for OpenJDK (Long Term Support)
environment
-
JDK(Java Development Kit)
-
JDK is the software required to develop / execute Java applications.
-
Development kit with Java virtual machine, compiler, class library, debugger
-
OracleJDK, OpenJDK (open source), AdoptOpenJDK (IBM, Microsoft, etc.)
-
** Integrated Development Environment (IDE) **
-
Software with various functions to support coding
-
Code editor, debugger, project management function, etc.
-
Execute from compilation to execution at once with the touch of a button
-
Eclipse, NetBeans, IntelliJ IDEA, etc.
The big picture of Java code
Class
- Java program basics
- Classes are ** chunks that perform specific functions within the app **
- String Class: String
- Math Class: Math function
- FileReader / FileWriter: Reading and writing text files
- Create an app by combining these classes
- In Java, make files and classes correspond
- ex: Hello class is defined in a file called Hello.java
Method
- Elements included under class {...} are members (fields, methods, constructors, etc.)
- Methods are ** members to represent the "functions" of the class, and ** represent the processing to be performed by the app **
- In Java, when you start the app, first find and execute the main method: ** Entry point **
package
- ** A container for classifying classes **
package com.example.demo.trySpring;
Under HelloController
class etc.
Name resolution
- Class is identified by ** package + class name **: ** Fully Qualified Class Name (FQCN) **
- FQCN:
package com.example.demo.trySpring.HelloController
Documentation comments
- Start with 2 asterisks in comments that can be used later to generate documents (* 1 for multi-line comments)
- Describe a description of the class and its members
/***Reads text from a character input stream,... //Class overview
*
*@see FileReader //Related item
*@author MarkReinhold //author
*@since1.1 //Introduced version
*/
/***Create a buffering character-input stream from… //Constructor overview
*@param in A Reader //argument
*@param sz Input-buffer size //argument
*@exception //exception
*@retutn //Return value
*/
Debugging basics
- ** Breakpoint setting **
- Ability to pause a running program
- Click the line number from the editor
- Check the status of the program at the breakpoint
- ** Debug execution **
- You can execute code sentence by statement from breakpoints: ** Step execution **
- Step in: Run one line
- Step over: Execute a method call on the way to the next line
- Step return: Execute until returning to the current method caller
- ** Execution resume / end **
- Resume to return to normal execution, end button to end