• 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
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Frank Carver
  • Henry Wong
  • Ron McLeod
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Himai Minh

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: 67663
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: 23928
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: 23928
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: 13069
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.
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic