This is an example of function with parameters but without return value in java programming.
CODING OF SIMPLE INTEREST BUTTON(jButton1)
float p,r,t,si;
p=Float.parseFloat(jTextField1.getText());
r=Float.parseFloat(jTextField2.getText());
t=Float.parseFloat(jTextField3.getText());
si(p,r,t);
CODING OF FUNCTION si()
void si(float a,float b,float c)
{
float s=(a*b*c)/100;
jTextField4.setText(" "+s);
}
CODING OF CLEAR BUTTON(jButton2)
jTextField1.setText(" ");
jTextField2.setText(" ");
jTextField3.setText(" ");
jTextField4.setText(" ");
CODING OF EXIT BUTTON(jButton3)
System.exit(0);
CODING |
RUNNING |
We have used NetBeans IDE 7.3. To download it visit www.netbeans.org
For any query or suggestion please comment below...
No comments:
Post a Comment