• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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 .
 
Sheriff
Posts: 5554
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: 79033
375
  • 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: 8837
631
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