• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
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: 5792
368
IntelliJ IDE Python TypeScript 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: 80222
424
  • 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

 
Sheriff
Posts: 8988
652
Mac OS X Spring 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.
 
You got style baby! More than this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic