0
0

Javaあれこれ

Last updated at Posted at 2024-09-01

1. Javaのバージョンを取得

System.getProperty("java.version"); 

2. OSの種類を取得

System.getProperty("os.name"); 

3. データ型を取得

オブジェクト.getClass();
オブジェクト.getClass().getSimpleName();

4. ヒープサイズ

Runtime.getRuntime().totalMemory();
Runtime.getRuntime().freeMemory();
Runtime.getRuntime().maxMemory();

java -Xms1m -Xmx3m クラス名 // 実行時にヒープサイズを指定

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