• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

BigInteger error

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Marshal
Posts: 5508
326
IntelliJ IDE Python Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You sure about that? Last time I checked it lived in java.math.
 
Marshal
Posts: 77157
370
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe you are thinking of Integer which is in the java.lang package.
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Marshal
Posts: 8612
623
Mac OS X VI Editor BSD Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic