HOw to check for EOf in java ...when the input if a BIgInteger.

Scanner sc= new Scanner(System.in)
while(sc.nextBigteger !=-1)
{
//
}
is the above code correct with respect to check the input?

  • created

    Jun '07
  • last reply

    Jun '07
  • 1

    reply

  • 181

    views

  • 2

    users

Have a look at the API - theres a hasNext... method for each input type, or it will throw an exception.. it definitely won't return -1.

Suggested Topics

Want to read more? Browse other topics in JAVA based languages or view latest topics.