File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Error problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Error problems" Watch "Error problems" New topic
Author

Error problems

Kevin Quarles
Greenhorn

Joined: Sep 07, 2009
Posts: 26
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

Joined: Jan 10, 2002
Posts: 61106
    
  66

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
putting together all those snippets, it compiled and ran OK fo me.
Kevin Quarles
Greenhorn

Joined: Sep 07, 2009
Posts: 26
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

Joined: Sep 07, 2009
Posts: 26
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
Sheriff

Joined: Sep 28, 2004
Posts: 18765
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Kevin Quarles
Greenhorn

Joined: Sep 07, 2009
Posts: 26
You have got to be kidding me! I changed it to plain text, and bingo!

What is the difference?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18765
    
  40

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

Joined: Mar 30, 2008
Posts: 13
You can refer examples from www.java2examples.com for help
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11257
    
  16

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.


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error problems