I am studying Java at an in-house rookie study session. Here are some of the things I learned that were particularly interesting. The 1st to 4th sessions are using Progate / Clear Java, and the 5th session is using Java Practice Edition.
Go to the following site for Progate https://qiita.com/wdmmm/items/0fa27221498e767c953a
Variable names are written in basic camel case. Example: userName
The magic number is basically not used. Example: name1, name2, name3, ...
You can't omit the variable name too much or it's too long. .. ..
・ Readable code
Passing the value of a variable of the basic data type itself is called passing by value.
Passing a reference to a variable other than the basic data type is called passing by reference.
Multiple threads are called multithreads. It means that it is safe to process at the same time with multiple threads. A thread-safe design is a class or method that is safe to use multiple threads at the same time.
A convenient class for manipulating basic data types as objects. Example: int → Integer, long → Long (The left side is the basic data type and the right side is the wrapper class.)
It is used in Integer.parseInt () and so on.
A class that concatenates strings. It is overwhelmingly faster than concatenating character strings with +.
StringBuilder may be overwritten if you try to process the same target when multithreading. On the other hand, StringBuffer processes one by one even if the same target is processed at the time of multithreading. It will not be overwritten, but it will be slower than StringBuilder.
The study session will continue, so I will review the preparations and review. I wanted to be aware of it when I came across something that I found interesting. I'm planning to learn about Spring next year, so I'd like to acquire Java knowledge properly and attend a study session.
Recommended Posts