1
1

No.11 変数・データ型

Last updated at Posted at 2024-07-17

変数

◆かごの様なイメージ

◆ある手段(後述)を取らないと1つのかごに1つの商品しか入らない

◆かごに名前をつけたものを変数名という
image.png

データ型

【動画URL】 https://youtu.be/ur83kCFPnE8?feature=shared

変数(かご)にどの様な値(もの)が入るか指定しないといけない

基本型(プリミティブ型)
boolean true or false
char 1文字を扱う、シングルクォーテーションでくくる(‘あ’)
byte 8ビット整数 -128~127
short 16ビット整数 -32,768~32,767
int 32ビット整数 -2,147,483,648~2,147,483,647
long 64ビット整数 -9,223,372,036,854,775,808~9,223,372,036,854,775,807
float 32ビット単精度浮動小数点数
double 64ビット倍精度浮動小数点数

※1bitとはコンピュータが扱うデータの最小単位のこと

参照型
String 文字列を扱う、“(ダブルクォーテーション)でくくる("こんにちは")


まとめてご覧になりたいあなたは
https://zenn.dev/codek2/books/63c880c460c21e

詳しく学びたいあなたは
https://zenn.dev/codek2/articles/e9e44f3e0023fb

Youtube
https://youtube.com/@codek2_studio?feature=shared

Twitter
https://twitter.com/kunchan2_

Zenn
https://zenn.dev/codek2

1
1
1

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
1
1