• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error problems

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am a beginning Java student. I am supposed to program a payroll program, and now I am getting two types of errors on 76 different occasions:

#1- Illegal Character\92\par
and
#2- ; expected.....However, I am including the ; in my programming. I have no idea what to do now. Can someone help? I am using JDK 1.6.0_16. I am using wordpad to create.

here is the code I have so far:



 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Here's the best first hint I can give you: Please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.

You can go back and change your post to add code tags by clicking the button on your post.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
putting together all those snippets, it compiled and ran OK fo me.
 
Kevin Quarles
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:putting together all those snippets, it compiled and ran OK fo me.



My command prompt just comes up with 76 errors. Most are illegal character\92\par

a few says ; expected

What do I do?

If someone could tell me how to copy and paste the command prompt on this, I will show you
 
Kevin Quarles
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Michael Dunn wrote:putting together all those snippets, it compiled and ran OK fo me.



These are the errors I am getting:


{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Ti
mes New Roman;}{\f1\fswiss\fcharset0 Arial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Ti
mes New Roman;}{\f1\fswiss\fcharset0 Arial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Ti
mes New Roman;}{\f1\fswiss\fcharset0 Arial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Ti
mes New Roman;}{\f1\fswiss\fcharset0 Arial;}}
^
PayrollProgram.java:1: illegal character: \92
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Ti
mes New Roman;}{\f1\fswiss\fcharset0 Arial;}}
^
^
PayrollProgram.java:1: class, interface, or enum expected
{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\froman\fprq2\fcharset0 Ti
mes New Roman;}{\f1\fswiss\fcharset0 Arial;}}

^
^
^
PayrollProgram.java:2: class, interface, or enum expected
{\colortbl ;\red0\green0\blue0;\red38\green90\blue255;}
^
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Make sure that you tell WordPad to save the file as a text file -- or better yet, use a text editor instead. The java compiler seems to be choking on the formatting data -- as you seemed to have saved the program in some sort of rich text format.

Henry
 
Kevin Quarles
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have got to be kidding me! I changed it to plain text, and bingo!

What is the difference?
 
Henry Wong
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kevin Quarles wrote:What is the difference?



One is a text file. The other isn't.... This is why you should use a real text editor, instead of a word processor wannabe.

Henry
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can refer examples from www.java2examples.com for help
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when you saved the document originally, the editor put in all the formatting characters...i.e. bold, centered, fonts, etc. when your editor displays the document, it doesn't display them, it uses them to figure out HOW to display it.

When you save your file as plain text, you're saying "only save the actual characters I type", so that extra stuff isn't in there.
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic