[Note] What I learned in half a year from inexperienced (Java) (1)

Java

1. 1. Feature

There are two features of Java.

1) Object-oriented language

The idea is to create one program as an "object". Because it is a way of thinking, many learners are troubled. Object-oriented has three characteristics.

・ Inheritance ·Encapsulation ・ Polymorphism

I will briefly describe the above three features. "Inheritance" is to inherit the characteristics and properties. "Encapsulation" is the protection of data and values. "Polymorphism" is a method that allows others to change little by little based on one framework.

2) Multi-platform

In Java programs, there is a class file called ".class" that can be done through "compilation" work that checks the grammar etc. from the source file ".java". This class file can be run anywhere you have a Java VM (Java Virtual Machine). Why can it work anywhere with a Java VM? There are two reasons, the first is "JavaVM executes the class file". The second reason is that "Java VM absorbs the difference even if the OS is different".

2. variable

A "variable" is like a box that holds data. There are three things I've learned with variables.

1) static variable

A static variable is a variable that can be shared by one ~~ method ~~ instance and another ~~ method ~~ instance. Suppose you have methods A and B. Suppose you have each shared static variable. If you change the value of one variable, the compilation will not work unless you change the value of the other variable.

2) Member variables

Member variables are variables defined in a class.  class A{ int b = 10; ・ ・ ・ } It's like the int type variable b above. Member variables can be used with any method defined in the class.

3) Local variables

Local variables are variables defined within a method.

class A { int b = 10; // member variable   public void methodc(){ int d = 20; // local variables   } public void methode(){ int f = 30; // local variables System.out.println (f); // Displayed } }

The range of access differs depending on whether it can be output with member variables or local variables. Such a range is called a "scope".

Next time I will write "array" etc.

Recommended Posts

[Note] What I learned in half a year from inexperienced (Java)
[Note] What I learned in half a year from inexperienced (Java) (1)
[Note] What I learned in half a year from inexperienced (Java) (3)
What I learned when building a server in Java
What I learned from Java monetary calculation
What I learned in Java (Part 2) What are variables?
What I learned in Java (Part 3) Instruction execution statement
What an inexperienced engineer who took a leave of absence from college learned in 2020
What I learned in Java (Part 4) Conditional branching and repetition
What I pointed out as a reviewer for half a year
What I learned from studying Rails
I created a PDF in Java.
What I learned with Java Gold
What I learned with Java Silver
What I have learned in Java (Part 1) Java development flow and overview
What I learned from doing Java work with Visual Studio Code
What is a class in Java language (3 /?)
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
A note of what I stumbled upon and noticed in catching up with Laravel from Rails
[Rails] What I learned from a little stumbling block when using ancestry
[JAVA] Project Euler, I got stuck in Q8, so make a note
What I don't like when using interface of a function with default arguments in Kotlin from Java
What i learned
I made a primality test program in Java
I tried hitting a Java method from ABCL
A note when you want Tuple in Java
I wanted to make (a == 1 && a == 2 && a == 3) true in Java
I wrote a primality test program in Java
I made a rock-paper-scissors game in Java (CLI)
A quick review of Java learned in class
I wrote a prime factorization program in Java
Summary of what I learned in Spring Batch
# 2 [Note] I tried to calculate multiplication tables in Java.
I tried to create a Clova skill in Java
What I learned ② ~ Mock ~
A note for Initializing Fields in the Java tutorial
I tried to make a login function in Java
What I learned ① ~ DJUnit ~
[Note] Create a java environment from scratch with docker
A quick review of Java learned in class part3
I made a Wrapper that calls KNP from Java
[Rilas] What I learned in implementing the pagination function.
A quick review of Java learned in class part2
Call a program written in Swift from Processing (Java)
I tried to find out what changed in Java 9
How a liberal arts engineer passed Java Silver in half a year after joining the company
I tried to make an application in 3 months from inexperienced
[Beginner] I made a program to sell cakes in Java
I just wanted to make a Reactive Property in Java
How to store a string from ArrayList to String in Java (Personal)
What I did in the version upgrade from Ruby 2.5.2 to 2.7.1
Easily get an integer from a system property in Java
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
I tried to convert a string to a LocalDate type in Java
I tried to make a client of RESAS-API in Java
Get a non-empty collection from an Optional stream in java
A note about Java GC
What I researched about Java 8
What I researched about Java 6
I made roulette in Java.