this how I review basics of a language to write what I reviewed in blog posts also it will be good interance for Android development. the good news now it become dialy as I need to review also other languages before release some open source case studies this blog post is the last one of numbers series lets view some methods.
min()
The method gives the smaller of the two arguments. The argument can be int, float, long, double.
double min(double arg1, double arg2) float min(float arg1, float arg2) int min(int arg1, int arg2) long min(long arg1, long arg2)
- A primitive data types
- This method Returns the smaller of the two arguments.
Example:
public class Test{ public static void main(String args[]){ System.out.println(Math.min(12.123, 12.456)); System.out.println(Math.min(23.12, 23.0)); } }
max()
The method gives the maximum of the two arguments. The argument can be int, float, long, double.
double max(double arg1, double arg2) float max(float arg1, float arg2) int max(int arg1, int arg2) long max(long arg1, long arg2)
- A primitive data types
- This method Returns the maximum of the two arguments.
Example:
public class Test{ public static void main(String args[]){ System.out.println(Math.max(12.123, 12.456)); System.out.println(Math.max(23.12, 23.0)); } }
Leave a Reply