Guest User

Untitled

a guest
Jan 19th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. public class A { String text; int count;}
  2. public class B { public static void main(String[]args)
  3. {
  4. A a= new A();
  5. a.text="Text";
  6. a.count=10;
  7. }
  8. }
  9.  
  10. public class A {
  11.  
  12. String text;
  13. int count;
  14.  
  15. public A(String text; int count){
  16. this.text=text;
  17. this.count=count;
  18. }
  19.  
  20. }
  21.  
  22. public class B { public static void main(String[]args)
  23. {
  24. A a= new A("Text",10);
  25.  
  26. }
  27. }
  28.  
  29. public class A { String text; int count;
  30.  
  31. public void setText (String text){this.text=text};
  32. public String getText(){return text};
  33.  
  34. public void setCount (int count){this.count=count};
  35. public String getCount(){return count};
  36.  
  37. }
  38. public class B { public static void main(String[]args)
  39. {
  40. A a= new A();
  41. a.setText("Text");
  42. a.setCount(10);
  43. }
  44. }
  45.  
  46. public class SomeClass {
  47.  
  48. private final SomeInterface someImplementation;
  49. private final OtherInterface otherImplementation;
  50.  
  51. @Autowired // or without autowired if you don't use Spring
  52. public SomeClass(SomeInterface someImplementation, OtherInterface otherImplementation){
  53. this.someImplementation= someImplementation;
  54. this.otherImplementation= otherImplementation;
  55. }
  56. // class functionality here
  57. }
Add Comment
Please, Sign In to add comment