Program:
package nulticlass;
public class multi {
public static void main(String[] args){
multa object=new multa();
object.mela();
object.another_mela();
}
}
public class multa {
public void mela(){
System.out.println("here this is multi class in this program");
}
public void another_mela(){
int a=12,b=48,result=a+b;
System.out.println("the output of the method is "+ result);
}
}
Output:
here this is multi class in this program
the output of the method is 60
package nulticlass;
public class multi {
public static void main(String[] args){
multa object=new multa();
object.mela();
object.another_mela();
}
}
public void mela(){
System.out.println("here this is multi class in this program");
}
public void another_mela(){
int a=12,b=48,result=a+b;
System.out.println("the output of the method is "+ result);
}
}
Output:
here this is multi class in this program
the output of the method is 60
Screenshot
Program
Step 1:class
Step 2:Another class
Output
No comments:
Post a Comment