简体   繁体   English

如何打印最大值和最小值?

[英]How to print max and min value?

Is it possible to print the maximum and minimum value of integer data type? 是否可以打印整数数据类型的最大值和最小值? If yes then how to do that? 如果是,那该怎么做?

Thanks in advance. 提前致谢。

Yes it is possible. 对的,这是可能的。 Use Integer.MAX_VALUE and Integer.MIN_VALUE . 使用Integer.MAX_VALUEInteger.MIN_VALUE You will get the max and min value. 您将获得最大值和最小值。

Simply reference oracle docs to see more related variables and methods 只需参考oracle文档即可查看更多相关的变量和方法

http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html http://docs.oracle.com/javase/7/docs/api/java/lang/Integer.html 在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM