Memorandum of new graduate SES [Java basics]

Introduction.

I joined an SES company as a new graduate in April this year. Currently, he is resident at a major SIer and is participating in a project subsidized by the Ministry of Economy, Trade and Industry.

You cannot log in to your personal computer on your business PC. I can't see my memo, so I searched for Qiita and posted it.

[Java Basics]

This is a Java memo for new employee training.

・ Sequential, branch, repeat

No matter how complicated the program, it can be created by combining the three control structures of sequential, branching, and repeating (structural theorem).

The for statement is suitable for simple iterations. When the number of repetitions is fixed. It is suitable for while statements and iterative processing that requires complicated processing.

・ For sentence repeat ① Initialization process int i = 0; ② Repeat condition i <10; ③ Repeated processing i ++

・ While statement repeats (between) → Control syntax components [Conditional expression] An expression showing branching conditions and conditions for continuing repetition [Block] A collection of sentences to be executed by branching or repeating

-Switch statement Processing corresponding to each case case 1; (in the case of) case 2; (in the case of) case 3; (in the case of)

・ Break statement Used when interrupting repetition (required for switch statement)

-Continue statement: Unlike the break statement, the repetition is not interrupted. (Skip to the next process)

・ Array

A data structure is a collection of data stored in a fixed format so that it can be easily handled by a computer program.

"Array" is a typical example. A data structure that stores the same type of data side by side. It is called a "reference type" because it refers to an address in memory.

The reference type has no specific value, new, and assigns a pointer (address in memory) to the instance as a reference value.

(Primitive types start with all lowercase letters. Unlike reference types, they have no methods. Specific data values (numerical values and characters) written directly to the memory can be assigned. )

-Creation (declaration) of array variables

//Element type[ ]Array variable name= new Element type[ ];

int[] score = new int[5];

-Array for loop (used when executing iterative processing under specified conditions)

public class Main {
  public static void main(String[] args) {
    int[] score = {1,2,3,4,5};              
    for (int i = 0; i < score.length; i++){  //Array name.Get the number of elements by length.
      System.out.println(score);
    }
  }
}

-Extended for statement (Unlike a normal for statement, it is not possible to extract some elements)

public class Main {
  public static void main(String[] args) {
    int[] score = {1,2,3,4,5};
    for (int value : score){                 //When the loop goes around once, the next element enters value.
      System.out.println(value);
    }
  }
}

・ Method

A method is a collection of multiple statements that are named as a single process. The smallest unit of a part.

→ Divide the process in the main method into multiple methods and take charge of each process. Example) The boss (main method) assigns work to his subordinates (other methods).

Java programs start from main.

・ Advantages of the method (1) The outlook of the program is improved and it is easier to grasp the whole. (2) Since it is described in functional units, the correction range can be limited. (3) Work efficiency is improved by combining the same processing into one method.

-Method call Method name (argument list)

//Example) hello();Call the hello method

public class Main {
  public static void main(String[] args) {
    System.out.println("Call the method.");
    hello();
    System.out.println("The method has finished calling.");
  }
  public static void hello() {
    System.out.println("Hello");
  }
}

/*Execution result
Call the method.
Hello
The method has finished calling.
*/

-Overloading (overloading) means defining a method with the same name. → Valid if the number or type of formal arguments is different Invalid if the arguments are the same but only the return type is different

-Both the sender and the receiver are called arguments, but they can be subdivided. Argument on the sending side → actual argument (argument) Recipient argument → Formal argument (parameter)

in conclusion.

SES resident at the customer's site may have a narrow shoulder. I will do my best to learn Java while doing my best!

reference

[Introduction to Java that is refreshingly understood 3rd edition (refreshing series)] (https://www.amazon.co.jp/%E3%82%B9%E3%83%83%E3%82%AD%E3%83%AA%E3%82%8F%E3%81%8B%E3%82%8BJava%E5%85%A5%E9%96%80-%E7%AC%AC3%E7%89%88-%E3%82%B9%E3%83%83%E3%82%AD%E3%83%AA%E3%82%B7%E3%83%AA%E3%83%BC%E3%82%BA-%E4%B8%AD%E5%B1%B1%E6%B8%85%E5%96%AC/dp/4295007803/ref=zg_bs_515820_1?_encoding=UTF8&psc=1&refRID=VVG291GHWRA9V6TW57NE/)

Thank you very much for your help. Great for getting started with Java basics and object orientation.

Recommended Posts

Memorandum of new graduate SES [Java basics]
Memorandum of new graduate SES [Java object-oriented edition]
Basics of character operation (java)
Experience of passing Java Silver as a new graduate
Summary of Java language basics
Java memorandum
Java basics
Java basics
JAVA memorandum
Java basics
[# 1 Java] Basics of Java-Major premise before studying-
[day: 5] I summarized the basics of Java
Looking back on the basics of Java
Rails Basics of creating a new application
Introduction of New Generation Java Programming Guide (Java 10)
Introduction of New Generation Java Programming Guide (Java 11)
Basics of java basics ② ~ if statement and switch statement ~
Introduction of New Generation Java Programming Guide (Java 12)
Java memorandum (list)
java programming basics
Basics of Ruby
Java JAR basics
Object-oriented (Java) basics
java1.8 new features
Basics of threads and Callable in Java [Beginner]
Java concurrency basics
I touched on the new features of Java 15
Java study memorandum
[Introduction to Java] Basics of java arithmetic (for beginners)
[Java] Overview of Java
[Java] Optional memorandum
[For beginners] Quickly understand the basics of Java 8 Lambda
Summary of revisions (new era) support by Java version
Career theory that new graduate engineers of humanities think
[In-house study session] Basics of Java annotation (2017/11/02) ~ Under construction ~
[Java] When writing the source ... A memorandum of understanding ①
I summarized the types and basics of Java exceptions
Expired collection of java
Predicted Features of Java
Java 12 new feature summary
[Java] Significance of serialVersionUID
NIO.2 review of java
Review of java Shilber
Java 13 new feature summary
java --Unification of comments
Java programming basics practice-array
webApi memorandum in java
History of Java annotation
java (merits of polymorphism)
Java Network Basics (Communication)
Basics of try-with-resources statement
Java8 Silver exam memorandum
What's new in Java 8
NIO review of java
Java 10 new feature summary
Muscle Java Basics Day 1
[Java] Three features of Java
Java8 Gold exam memorandum
Java 14 new feature summary
What's new in Java 9,10,11
Summary of Java support 2018