|
How to Merge all classes into One class
I am having total 3 classes and i want to merge all into one class.
EG:A,B,C are different type of documents
class A
Class B
Class C
Now i want all of them into one single class
I have taken
Class D{
public void A()
{System.out.println("A");
}
public void B()
{System.out.println("B");
}
public void C()
{System.out.println("C");
}
}
class MainClass()
{public static void main(string args[]){
MainClass m=new MainClass();
string doctype="A,B,C";
System.out.println("Eneryour Doctype:" +doctype);
if (doctype="A"){
m.A();
}
if (doctype="B"){
m.B();}
if (doctype="C"){
m.C();
}
}
Am i correct???if not i need your suggestions ...
thanks in advance...
-jazz
|