tiandi

1、除法运算

编程的人都知道,java中的“/”、“%”运算,其中前者为取整,后者取余数。那么有没有快捷的运算方法取正常的运算结果呢?

查了资料,发现很简单。代码如下:

public static String txfloat(int a,int b) 
{ DecimalFormat df
=new DecimalFormat("0.00");//设置保留位数 return df.format((float)a/b); }

2、有双引号的String

3、判断2个字符串是否相等

分类:

技术点:

相关文章:

  • 2022-01-05
  • 2021-06-08
  • 2021-09-22
  • 2021-12-14
  • 2022-01-02
  • 2021-12-01
  • 2021-09-18
猜你喜欢
  • 2021-12-17
  • 2022-01-07
  • 2021-10-21
  • 2021-12-05
  • 2021-05-21
  • 2021-06-15
  • 2022-12-23
相关资源
相似解决方案