How do I Implement Operators in a Java Class

后端 未结 7 1819
南旧
南旧 2020-12-07 01:30

I am attempting to create a unsigned integer class.

public class UnsignedInteger extends Number implements Comparable 
    { 
    ...          


        
7条回答
  •  独厮守ぢ
    2020-12-07 02:18

    Java doesnt support operator overloading, they consider it a bad practice, knowing that they overloaded + and += operators for the String class

提交回复
热议问题