testmethod.java
来自「这是一张java应用教程的随书光盘」· Java 代码 · 共 25 行
JAVA
25 行
class Testmethod
{double x, y ;static float mark;
float total(float a,float b)
{
float total;
x=0.4;y=0.6;
total=(float)(x* a+ y* b);
return total;
}
static void setmark(float i)
{ mark=i;}
static float getmark( )
{return mark ;}
public void display()
{System.out.println("The total score" + "=" + mark);
}
public static void main(String[] args)
{
Testmethod tm = new Testmethod ();
mark=tm.total(67,98);
tm.display();
tm.setmark(96);
tm.display();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?