Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use Math System tostring for API classes commonly used in Java

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "how to use Math System tostring in API classes commonly used in Java". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

1. Note (the class name cannot be the same as math, otherwise an error may be reported)

1.math: an interface class that can be used directly

Math.abs (- 90); returns the absolute value of the parameter

Math.max (60,098) returns the maximum value of the parameter

Math.random () * 100Random function: randomly outputs a number

Wait

Public static void main (String [] args) {int a = 1300, b = 1000; System.out.println (Math.abs (- 90)); System.out.println (Math.max (606,98)); System.out.println (Math.random () * 100); System.out.println (Math.ceil (b));}}

Results:

API of 2.System:

System.exit (0); / / the down content java code under this API will stop execution

System.currentTimeMillis (); / / returns the number of milliseconds since 1970

Public class tyue {public static void main (String [] args) {System.out.println ("go!") ; / / System.exit (0); System.out.println ("over!"); System.out.println (System.currentTimeMillis () * 1x1000, 60, 60, 24, 365 + "year"); Long begin=System.currentTimeMillis (); for (int item0, Tinci)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report