• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Scanner and useDelimiter

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've researched this quite a bit and I just do not understand where I am going wrong, or if it even is an error, and regardless of what the actual problem is how to fix it.


Scenario constants:

Ubuntu 14.10 (GNU/Linux 3.16.0-31-generic i686)
Oracle Java 1.8.0 SDK from webupd8 repository

java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) Server VM (build 25.40-b25, mixed mode)




It seems that in every instance where I try use:



or


or even the expanded syntax in a full example below:



even valid strings from Oracle's examples such as:



The java compiler will throw an error




I've read a few recommendations that I should download and replace the regular expressions library in java with a working regex but before I go through all thatI need to be certain that the issue is not with me.

I've given up on Java many times before because of silly little things like this. I do plan on being a little more proactive this time, I do not know why the strangest things just keep happening between Java and I though.


 
Marshal
Posts: 80665
478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you got another class called Scanner?
 
Campbell Ritchie
Marshal
Posts: 80665
478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
… and welcome to the Ranch
 
Jaqueline Moutton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:… and welcome to the Ranch



Thank you.

Campbell Ritchie wrote:Have you got another class called Scanner?



No the expanded full example is the entire program. There is only one <Scanner> and only one object [sc]

I am at at a loss.

The error happens even in isolation of the class as a simple program.
 
author
Posts: 23959
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hint: How do you spell Delimiter? ...

Henry
 
Jaqueline Moutton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:
Hint: How do you spell Delimiter? ...

Henry





Thank you.

Man, do I feel stupid now.

I even though I cut and pasted a few examples in, but I guess the blinders were truly and securely on.


 
Campbell Ritchie
Marshal
Posts: 80665
478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:
Hint: How do you spell Delimiter? ...

Henry

It was posted correctly in three of the four examples in the original post. That is why you should always copy and paste code.
Lost of people make that sort of mistake.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic