minvariablesdemo.java
来自「这是一个英文版的《Java程序设计与问题解决》现在好多大学都当成教材」· Java 代码 · 共 35 行
JAVA
35 行
public class MinVariablesDemo { public static void main(String args[]) { // integers byte smallestByte = Byte.MIN_VALUE; short smallestShort = Short.MIN_VALUE; int smallestInteger = Integer.MIN_VALUE; long smallestLong = Long.MIN_VALUE; // real numbers float smallestFloat = Float.MIN_VALUE; double smallestDouble = Double.MIN_VALUE; // other primitive types char aChar = 'r'; boolean aBoolean = false; // display them all System.out.println("The smallest byte value is " + smallestByte); System.out.println("The smallest short value is " + smallestShort); System.out.println("The smallest integer value is " + smallestInteger); System.out.println("The smallest long value is " + smallestLong); System.out.println("The smallest float value is " + smallestFloat); System.out.println("The smallest double value is " + smallestDouble); if (Character.isLowerCase(aChar)) { System.out.println("The character " + aChar + " is lower case."); } else { System.out.println("The character " + aChar + " is upper case."); } System.out.println("The value of aBoolean is " + aBoolean); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?