Advertisement
Guest User

Untitled

a guest
Oct 29th, 2014
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.42 KB | None | 0 0
  1. // diketahui:
  2. class X(param1: someType0){
  3.     ...
  4. }
  5.  
  6. object X{
  7.     def apply(param1: someType1, param2: someType2){
  8.         ...
  9.     }
  10.     def apply(param1: someType1){
  11.         ...
  12.     }
  13.     def apply(param2: someType2){
  14.     ...
  15.     }
  16. }
  17.  
  18.  
  19. // ditanyakan:
  20. object Y extends X{
  21.     ....    
  22. }
  23.  
  24. // gimana caranya, biar constructor Y bisa dibangun dengan parameter bertipe someType1/someType2, tapi bukan someType0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement