Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public class ProbvamMetod {
  2. public double[] myList;
  3.  
  4. public ProbvamMetod(double[] myList)
  5. {
  6. for(int i = 0; i<myList.length; i++)
  7. this.myList[i] = myList[i];
  8. }
  9.  
  10. public String toSstring(){
  11.  
  12. StringBuffer sb = new StringBuffer("[");
  13. for (double oneInt : myList) {
  14. sb.append(oneInt);
  15. sb.append(", ");
  16. }
  17. sb.append(" ]");
  18. return sb.toString();
  19. }
  20.  
  21.  
  22. public static void main(String [] args)
  23. {
  24. ProbvamMetod pm = new ProbvamMetod(new double[]{5,2,3,7});
  25. pm.toSstring();
  26.  
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement