• Post Reply Bookmark Topic Watch Topic
  • New Topic

BigInteger error  RSS feed

 
Sushant Kunwara
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am getting error in this code :



Error is :


G:\Java>javac Main1.java
Main1.java:9: error: cannot find symbol
ArrayList<BigInteger> array = new ArrayList<BigInteger>();
^
symbol: class BigInteger
location: class Main1
Main1.java:9: error: cannot find symbol
ArrayList<BigInteger> array = new ArrayList<BigInteger>();
^
symbol: class BigInteger
location: class Main1
2 errors


Could not understand why I am getting it ? BigInteger is in lang package , so no need to import it .
 
Tim Cooke
Marshal
Posts: 4037
239
Clojure IntelliJ IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You sure about that? Last time I checked it lived in java.math.
 
Campbell Ritchie
Marshal
Posts: 56518
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you are thinking of Integer which is in the java.lang package.
 
Sankalp Bhagat
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BigInteger class is available in java.math package. so you need to import that class in order to use it. try compiling below code

 
Liutauras Vilda
Sheriff
Posts: 4914
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sankalp Bhagat wrote:try compiling below code
If decent Java version is used, on line 5 second time explicitly specify the type argument is not needed.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!