Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int compareTo(Figura figura) {
- double pole1 = this.pole();
- double pole2 = figura.pole();
- double obwod1 = this.obwod();
- double obwod2 = figura.obwod();
- if(pole1 < pole2){
- return -1;
- }
- if(pole1 > pole2){
- return 1;
- }
- if(obwod1 > obwod2){
- return -1;
- }
- if(obwod1 < obwod2){
- return 1;
- }
- if(this.FigNo > figura.FigNo){
- return 1;
- }
- if(this.FigNo < figura.FigNo){
- return -1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement