LoginSignup
0
0

More than 1 year has passed since last update.

Java基礎 まとめ

Last updated at Posted at 2022-08-02

基本知識

・ネスト □{ } の中に { } を記述すること
・ブロック

スクリーンショット 2022-08-02 13.42.29.png

・変数宣言 □変数を新しく作ること
型名 変数名 ;
int age;
・初期化 □変数宣言と同時に値を代入すること
型名 変数名 = 初期データ;
int age = 20;
・定数 □初期化された状態からデータを変更することのできない変数のこと
※定数名は半角英数の大文字で記述することが一般的
final 型名 定数名 = 初期値(固定値);
final String USER_NAME = tarou;
・リテラル

スクリーンショット 2022-08-02 14.29.24.png

基本ルール

・ファイル名とクラス名を同じにする

ファイル名:Sample1.java

class Sample1 {

}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0