• Post Reply Bookmark Topic Watch Topic
  • New Topic

Scanner and useDelimiter  RSS feed

 
Jaqueline Moutton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.


 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got another class called Scanner?
 
Campbell Ritchie
Marshal
Posts: 56562
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
… and welcome to the Ranch
 
Jaqueline Moutton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hint: How do you spell Delimiter? ...

Henry
 
Jaqueline Moutton
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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: 56562
172
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!