Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer
Introduction to JAVA
before doing any JAVA Programs.
*********************************************************************************************
Refer Sum(predefined values) and Sum(user defined values) also.
Next chapter CJ-26 : Accept Radius in meter
*********************************************************************************************
import java.io.*;
class add
{
int a,b,c;
add()
{
}
add(int x,int y)
{
a=x;
b=y;
c=a+b;
System.out.println("Addition ="+c);
}
}
class sub
{
int n,m,s;
sub()
{
}
sub(int h,int j)
{
n=h;
m=j;
s=n-m;
System.out.println("Subtraction ="+s);
}
}
public class con1
{
public static void main(String args[])
{
add a=new add(10,20);
sub b=new sub(60,20);
}
}
No comments:
Post a Comment