beginners put classes on same package(folder)
*************************************
create your first class
public class A {
public static void main(String[] args){
String c="input";
String b=add(c);
}
}
Create you second class
public class B {
public static String add(String d){
String f="output";
String g=d;
d=f+" "+g;
return d
}
}
OUTPUT will be like
input output
*************************************
create your first class
public class A {
public static void main(String[] args){
String c="input";
String b=add(c);
}
}
Create you second class
public class B {
public static String add(String d){
String f="output";
String g=d;
d=f+" "+g;
return d
}
}
OUTPUT will be like
input output
0 Comments:
Post a Comment