//interface.isNull(){
// so it works for all the objects of the system .So this functionality can be provided via frameork part
//}
abstract class AbstractTest {
Object test;
void MethodSuper(){
}
AbstractTest(Object test){
this.test=test;
}
void Method2Super1(){
}
void Method2Super2(){
}
abstract void SubClassSpecified();
}
abstract class AbstractTest1 {
Object test;
void MethodSuper2(){
}
AbstractTest1(Object test){
this.test=test;
}
void Method2Super2(){
}
abstract void SubClassSpecified();
}
public class AddBusineessLogic implements SuperCommonTask {
@Override
public void display() {
System.out.println("add result");
}
@Override
public void appliationErro() {
System.out.println("this is application error Add case ");
}
@Override
public void systemErro() {
System.out.println("this is systemerror Add case");
}
@Override
public void validatenput() {
}
@Override
public void ShowError() {
}
@Override
public void IsErrorPresent() {
}
}
public class BusinessLogic {
public int Add(int a,int b){
return a+b;
}
int Subtract(int a,int b){
return a-b;
}
int Divide(int a,int b){
return a%b;
}
}
public class ClientClass {
SuperCommonTask add = new AddBusineessLogic();
SuperCommonTask multiply = new MultiplyBusineessLogic();
SuperCommonTask divide = new DivideBusineessLogic();
CommonPointOfOperation CommonPointOfOperationadd = new CommonPointOfOperation(
add);
BusinessLogic businesslogic=new BusinessLogic();
void EntryPoint(int a ,int b){
add.validatenput();
}
}
public class CommonPointOfOperation {
SuperCommonTask SuperCommon;
CommonPointOfOperation(SuperCommonTask SuperCommon) {
this.SuperCommon = SuperCommon;
}
void ShowError() {
SuperCommon.appliationErro();
}
void ShowApplicationError() {
SuperCommon.appliationErro();
}
void ShowsystemError() {
SuperCommon.systemErro();
}
}
public class DivideBusineessLogic implements SuperCommonTask {
@Override
public void display() {
System.out.println("Multiply result");
}
@Override
public void appliationErro() {
System.out.println("this is application error Multiply case ");
}
@Override
public void systemErro() {
System.out.println("this is systemerror Multiply case");
}
@Override
public void validatenput() {
// TODO Auto-generated method stub
}
@Override
public void ShowError() {
// TODO Auto-generated method stub
}
@Override
public void IsErrorPresent() {
// TODO Auto-generated method stub
}
}
public class InheritancePolymorphism {
void Method1(){
System.out.println("supermethod");
}
}
public class MultiplyBusineessLogic implements SuperCommonTask {
@Override
public void display() {
System.out.println("Multiply result");
}
@Override
public void appliationErro() {
System.out.println("this is application error Multiply case ");
}
@Override
public void systemErro() {
System.out.println("this is systemerror Multiply case");
}
@Override
public void validatenput() {
// TODO Auto-generated method stub
}
@Override
public void ShowError() {
// TODO Auto-generated method stub
}
@Override
public void IsErrorPresent() {
// TODO Auto-generated method stub
}
}
public class State1{
public static enum Test{
create("1")
,cancel("3")
,read("3")
,update("2")
,initread("3")
,initcancel("3")
,initupdate("3");
Test(String test){
this.test=test;
}
private String test;
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}
}
public interface SuperCommonTask {
void display();
void appliationErro();
void systemErro();
void validatenput();
void ShowError();
void IsErrorPresent();
}
No comments:
Post a Comment