• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error problems

 
Kevin Quarles
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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:



 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64958
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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;}
^
 
Henry Wong
author
Marshal
Pie
Posts: 21184
80
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
  • 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
Marshal
Pie
Posts: 21184
80
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • 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
 
Javed Inamdar
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can refer examples from www.java2examples.com for help
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic