Get the App
SLTechnology News&Howtos  ›  Development  › 

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

Shulou Source: shulou.com Published: 2022-06-03 00:41:19 09月17日 Update

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)

Tags: Commonly used content articles methods more parameters knowledge output practical obvious maximum not easy learned and then the number code functions can pass dilemma actual Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux MariaDB Shulou Technology Huawei MySQL