LoginSignup
0
0

More than 1 year has passed since last update.

データ型の種類まとめ

Posted at

はじめに

Rails、Javaを学び始めて、データ型についてざっくりと理解はしていましたが改めて記憶の定着を兼ねてアウトプットしたいと思います。

データ型とは
プログラムで扱うことができるデータの種類の事。

代表的な9種類のデータ型

整数

  • byte~とても小さな整数 //byte glasses; 所持眼鏡数
  • short~小さな整数 //short age; 年齢
  • int~普通の整数 //int salary; 給与金額
  • long~大きな整数 //long worldPeople; 世界人口

少数

  • float~少しあいまいでもよい小数 //float weight; 体重
  • double~普通の整数 //double pi; 円周率

真偽値

  • boolean~trueかfalse //boolean isError; エラーか否か

文字

  • char~1つの文字 //char initial; イニシャル1文字

文字列

  • String~文字の並び //String name; 自分の名前

おわりに

今回はデータ型についてアウトプットしました。
基本的にこの9つのデータ型を覚えておくことをお勧めします。
ご覧いただきありがとうございました!

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