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 Finding vowels help! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Finding vowels help!" Watch "Finding vowels help!" New topic
Author

Finding vowels help!

Vivian Chu
Greenhorn

Joined: Nov 03, 2008
Posts: 4
I am trying to read a text file of words to find the words that have all 5 vowels in order (a then an e then an i, etc) Then I want to print all the words that do all the vowels.

I am having problems with what I have written so far!

Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

Well, what compilation errors are you getting? And how do you think it can be fixed?

Henry


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

Joined: Nov 03, 2008
Posts: 4
It is saying

if(i = 'a') aisFound==true;

is not a statement.

I do not understand how to fix this?!?
Vivian Chu
Greenhorn

Joined: Nov 03, 2008
Posts: 4
Also, I know I need to declare the variables aisFound, eisFound, etc. Did I do this correctly? I want them to to be False initially.
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1815
That is a vague error message. What it means (in this case) is that you have your equality test and assignment operators backwards. Use == (double equals) for testing equality and = (single equals) for assignment.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Vivian Chu
Greenhorn

Joined: Nov 03, 2008
Posts: 4
I fixed the statement error, I am still confused on how to declare my variables: aisfound, etc.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

I am still confused on how to declare my variables: aisfound, etc.


Well, how do you declare a variable? I am assuming that you taking a class, or reading a book about Java.

It is not very efficient to do it via trial and error.

Henry
Ls chin
Ranch Hand

Joined: Jun 28, 2008
Posts: 99
Originally posted by Vivian Chu:
I fixed the statement error, I am still confused on how to declare my variables: aisfound, etc.


The 'true' or 'false' variable can only be boolean. Java keywords are also case sensitive. 'False' is not the same as 'false'.

Your code:


Did you get your comparison operator "==" mixed up with your assignment operator "="?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Finding vowels help!
 
Similar Threads
Applets and sound
I need help with my project! ADT
what are the return values of init method in servlets
Pick the odd man out
Passing Vector elements to an array