Results 1 to 3 of 3
- 03-04-2010, 06:09 PM #1
Member
- Join Date
- Mar 2010
- Location
- Lithuania
- Posts
- 22
- Rep Power
- 0
I need some help with composition, i think
Hi I am new in this forum so sorry if it isn't proper place to ask this question. So the question:
I have two classes:
public class card {
public void increase(Bankomatas b,int money){
themoney=b.papildymas(100, this);
System.out.println("It's OK");
}
}
public class Bankomatas {
public int money;
private int diabetas=2000;
public Bankomatas(int money){
this.money=money;
}
public themoney papildymas(int sask, card kor){
saskaita+=sask;
return null;
}
}
Error is in red. How I should it improve? :)
- 03-04-2010, 06:17 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
You are using 'themoney' as a variable at one place and as a return type at another place; that doesn't make sense.
kind regards,
Jos
- 03-04-2010, 06:24 PM #3
Member
- Join Date
- Mar 2010
- Location
- Lithuania
- Posts
- 22
- Rep Power
- 0
Similar Threads
-
What is the Composition in Java
By Santoshbk in forum Advanced JavaReplies: 4Last Post: 04-10-2008, 11:04 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks