0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Java 学習1(さまざまなデータ型を学ぶ)

Last updated at Posted at 2020-06-20

#記事の目的
業務でJavaを使うことになったので、
基本的なJavaの使い方をアウトプットし知識を整理するため

MyApp.java
public class MyApp{
  public static void main(String[] args){
  // 文字
  char a = 'a';
  // 整数 byte short int long
  int x = 10; 
  long y = 5555555555L; //long型の場合は最後にLをつける。

  //浮動小数点数 float double
  double d = 23423.344;
  float f = 32.33F;
  //論理値
  boolean flag = true; //false
  //文字列
  // \n
  // \t
  // String msg;
  // msg = "Hello World Again!"
  String msg = "Hello Wor\nld! Again";

  System.out.println(msg);
  }
}

##出力結果


$ javac MyApp.java
$ java MyApp
Hello Wor
ld! Again
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?