Progate Java (Beginner) Review & Summary

Nice to meet you!

This is my first post!

My profile

A junior high school student who started learning IT from the fifth grade of elementary school. The first language I learned was "C language" (laughs) Looking for a job! Languages that can be handled C language HTML & CSS (studying) Python (studying) Ruby (studying) Java (studying) You can make some things As I say many times, we are looking for a job!

Java review

Java is a language used for various purposes such as application and web development.

Basic

main.java



System.out.println("");

Output a string with this function What I thought here was "It's similar to the syntax of C language"

That's right!

Java was also designed to make it easier for c programmers to migrate! (Thank you) So the syntax rules came in smoothly! Highly recommended as a second for those who have learned c language

comment

main.java



//comment

Write the comment like this (also used in C) //でそのあとにコメントを書きます Be careful when writing comments, but when writing comments ・ Briefly ・ Easy to understand ・ Use where you think "it's hard to understand ..." I am aware of these three I like all the codes that are easy to read!

variable

Next is about "variables", which is not an exaggeration to say that they are always used in programming. --What are variables in the first place? --- A variable is like a box that can hold data. As anyone who uses C language will understand, you may have thought, "I have to think about memory quite a bit." And the c language declaration is confusing ... However, as I said earlier, Java is also made to be easy for c programmers to migrate, so the declaration is almost the same.

main.c



int num;
double piyo;

In C language, to declare the variable num of int, write like this And to declare the double variable piyo, write So next is Java

main.java



int num;
Double piyo;

No, let's do it almost together!

Yes. That's right. The only difference is whether the double d is lowercase or uppercase when declaring a double variable ... But well, it's easier to understand if you're used to this one. To be honest, I was surprised when I first saw the Python declaration.

main.py



num = 3
piyo = "qiita"

Depending on the language difference, it seems that the data is assigned as it is when declaring. Like Ruby.

operator

Asterisk (*) when multiplying numbers Hyphen (-) when pulling Slash when dividing (/) Plus (+) when adding Percentage (%) when giving a remainder

How to write an abbreviation when self-assigning to a variable Assuming that an int type variable x is defined

Uninflected word x = x + 10; x = x - 10; x = x * 10; x = x / 10; x = x % 10;

Abbreviation x += 10; x -= 10; x++; x--; x *= 10; x /= 10; x %= 10;

It was pretty refreshing Here, it is important to note that when writing self-assignment in abbreviation, "write the operator first". And x ++ is an abbreviation for 1+. It is often used for conditional branching called if statement.

Display variable values and concatenate strings

Use println () to print the value of the variable I will introduce all of them

main.java



int num;
Double piyo;

num = 1;
piyo = "qiita!";

System.out.println(num);
System.out.println(piyo);

System.out.println("Hello" + "qiita!");
System.out.println("Hello" + piyo);
System.out.println((double)piyo + "I'm a grader");

You can see the first one. Print the values of num and piyo with println () Below that, + is used to output the character strings together. Of course, it can also be concatenated with variables. However, if you enclose the variable in double quotation marks ("), it will be displayed as a character string instead of the variable, so be careful! At the end, int type (integer type) cannot be concatenated with a character string, so it is converted to double type (character string type) and displayed. This is a technique I often use!

Summary

-Java is similar to the C language syntax because it is also designed to be easy for C programmers to migrate. -Use println () to output a string ・ Comment starts at // -When declaring a variable, declare the type first. ・ Character strings can be connected to each other -To concatenate an int type and a character string, the int type must be converted to a double type. -Self-assignment has an abbreviated form

Thank you very much!

Thank you so much for watching I'm still immature, so if you have any suggestions, please I'm on Twitter: https://twitter.com/Atie44675100 I'll say it over and over again, but I'm looking for a job!

Recommended Posts

Progate Java (Beginner) Review & Summary
Java review
java beginner 3
java beginner
Java knowledge summary
Java Generics Summary
Java related summary
Java Beginner Exercises
Java 8 documentation summary
Java 11 document summary
Java IO review
Java Exercise "Beginner"
[Qualification Exam] (Java SE8 Gold) Learning Review & Summary
[Java SE 11 Silver] Arrays class method summary [Java beginner]
Java 12 new feature summary
[Summary] Java environment preparation
effective java 3rd summary
NIO.2 review of java
Review of java Shilber
Java 13 new feature summary
Java NIO 2 review notes
Java inner class review
Java static [Personal summary]
Thread safe summary ~ Java ~
Review Java annotations now
Java Primitive Specialization Summary
Java development link summary
Personal summary about Java
NIO review of java
Review java8 ~ Lambda expression ~
Java 10 new feature summary
java regular expression summary
Java 14 new feature summary
Summary of Java support 2018
Java design pattern summary
Java reserved word summary
Java8 Stream Rough Summary
[Java] Basic summary of Java not covered by Progate ~ Part 1 ~
What is Java Assertion? Summary.
[Java11] Stream Summary -Advantages of Stream-
Java starting from beginner, override
Java Collections Framework Review Notes
[Java] Summary of regular expressions
[Java] Summary of operators (operator)
Java8 stream, lambda expression summary
Object-oriented summary by beginners (Java)
Java, instance starting from beginner
[Java] Basic summary of Java not covered by Progate ~ Part 2 · List ~
Java starting from beginner, inheritance
Summary of Java language basics
Java study memo 2 with Progate
Java tips --Spring execution Summary
[Java] Summary of for statements
Summary of Java Math class
Study Java with Progate Note 1
[Java11] Stream Usage Summary -Basics-
[Java] Summary of control syntax
[Beginner] Java basic "array" description
Summary of java error processing
[Java] Summary of design patterns
[Java] Summary of mathematical operations