• Post Reply Bookmark Topic Watch Topic
  • New Topic

Error code and I don't know why  RSS feed

 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Guys/Girls,

When i try compile the below code I keep getting the following Java.18 error: illegal character: '\u001d' .... spent the last 50 mins trying to figure it out and no luck any help really appreciated

 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Somehow, you ended-up with a group separator character in line 18.  Just delete the line and that problem should go-away (there are other issues in your code however).
 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help, I deleted the line and that resolved that error. Your right also, after i got more errors so i updated my code as Below. i'm getting one error now, appears to be an issue with the class hmmm

 
Ron McLeod
Bartender
Posts: 1603
232
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if your class implements ActionListener, then you need to implement the the method defined in the ActionListener interface.  you should have see an compiler error something like this:

The type P1AppletMonth must implement the inherited abstract method ActionListener.actionPerformed(ActionEvent)
 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here we go all good. This is the working skeleton just got to add calculations etc.. now. Thanks again for your help
 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FINAL CODE BELOW:

 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really should learn how to format your code properly.  Properly indenting code makes its structure and organization clear. Your code is anything but.
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And why are you using applets? They are obsolete.

As well as the formatting problems, you have poorly chosen variable names. It is difficult to read lblmonth, and also difficult to tell how many words it contains (tfinput is just as bad). You shou‍ld capitalise the second word and spell the first word out in full. You will then find out you are using the bad form of so‑called Hungarian notation. Don't start off a variable by giving its type or its scope. Call it monthLabel, which is easier to read when you get used to “camelCase” notation.
 
Vincent Hammond
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feedback guys

I'm using Applets as they are part of my course...why they are still on? I have no IDEA.  Only doing Java a few weeks so Only can get better!! Thanks for the help sure i'll be back again very soon with more issues!!
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vincent Hammond wrote:...why they are still on? . . .
Ask. See what they say.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vincent Hammond wrote:I'm using Applets as they are part of my course...

That's like studying engineering at a school that makes its students use slide rules. Who does that anymore these days? Only schools that are way behind in their teaching methods.
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:. . . a school that makes its students use slide rules. . . .
What is wrong with slide rules? About 15 years ago there was a “History of Science” article about slide rules in Scientific American. I was quite surprised to see that I am historical, since I used slide rules at school myself. They have a major advantage over calculators for engineers, because they never make you think there is a significant difference between 3.99 and 4. I think for most engineers there isn't a significant difference between 3.00 and 4, but calculators insist on showing that difference to 12 decimal places
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Junilu Lacar wrote:. . . a school that makes its students use slide rules. . . .
What is wrong with slide rules?

There's nothing wrong with using slide rules. It's just not something that most modern schools make their students do anymore, at least not as part of normal instruction. If they do it as extra credit work or as a one- or two-hour "how to do it old school" section in the syllabus, I'd be impressed, but to do it as part of normal instruction, as though that's how anyone does it in the real world, that's horrific. Same deal with applets. Actually, I take that back. With applets, it's not even impressive at all, even as a "how to do it old school" extra credit section in the syllabus. Same way I would ask for my money back if a Web Application Building course included JSP scriptlets as anything but a demonstration of "how it used to be done but how it should never be done any more" part of the syllabus. I bet Bear would agree.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:I think for most engineers there isn't a significant difference between 3.00 and 4, but calculators insist on showing that difference to 12 decimal places

Even in my third-world engineering school in the Philippines, they taught us how to round to X significant digits.

BTW, the last time I touched a slide rule was in my high school trigonometry class, back in the late 70s, and again, in the Philippines. That's not to say that our schools are not good because my schooling has never been an obstacle for me, but I'm just sayin'.

Here's an article about slide rules from over 4 years ago: http://www.edn.com/electronics-blogs/voice-of-the-engineer/4390273/5-Engineers--Do-engineers-still-use-hand-slide-rules-

For the record, I think that if you still use a slide rule these days, then more power to you. However, if you're still learning how to program applets, go buy a newer book or ask for your money back.
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:. . . "how it used to be done . . ." . . .
Like using loops to populate arrays in order [1, 2, 3 ...]. Or explicit close() calls on buffered readers. There are lots of things that come under “how it used to be done,” aren't there. Applets is one of many such.
 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:
Junilu Lacar wrote:. . . "how it used to be done . . ." . . .
Like using loops to populate arrays in order [1, 2, 3 ...]. Or explicit close() calls on buffered readers. There are lots of things that come under “how it used to be done,” aren't there. Applets is one of many such.

I don't know if I'd lump those older idioms with applets. Applets are an obsolete technology, as you already pointed out. The former two things you mentioned are idioms that have more modern alternatives with new additions to the language. They're not necessarily obsolete the same way applets are though.

Not really sure where you're going with this now: are you trying to refute my prior statements or trying to show where my analogy with the slide rule falls apart (because all analogies have their limits), or just, I don't know, making conversation?
 
Campbell Ritchie
Marshal
Posts: 56600
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Making conversation. Sorry for being confusing.
Agree that those old idioms are still valid, even though there are newer counterparts. Applets, however, are well and truly dead.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!