Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class A { String text; int count;}
- public class B { public static void main(String[]args)
- {
- A a= new A();
- a.text="Text";
- a.count=10;
- }
- }
- public class A {
- String text;
- int count;
- public A(String text; int count){
- this.text=text;
- this.count=count;
- }
- }
- public class B { public static void main(String[]args)
- {
- A a= new A("Text",10);
- }
- }
- public class A { String text; int count;
- public void setText (String text){this.text=text};
- public String getText(){return text};
- public void setCount (int count){this.count=count};
- public String getCount(){return count};
- }
- public class B { public static void main(String[]args)
- {
- A a= new A();
- a.setText("Text");
- a.setCount(10);
- }
- }
- public class SomeClass {
- private final SomeInterface someImplementation;
- private final OtherInterface otherImplementation;
- @Autowired // or without autowired if you don't use Spring
- public SomeClass(SomeInterface someImplementation, OtherInterface otherImplementation){
- this.someImplementation= someImplementation;
- this.otherImplementation= otherImplementation;
- }
- // class functionality here
- }
Add Comment
Please, Sign In to add comment