Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-18-2007, 04:55 PM
Member
 
Join Date: Jul 2007
Posts: 5
leebee is on a distinguished road
While loop
Hi, i am using a bufferedReader to realines from a file but i have to put a while loop in, so it loops round and reads all 10 lines.

But how do i make the while loop work as i have tried everything i can think of,

String str;
str = bufReader.readLine()

while(str == null) -- but i want it to say not null but !== null, doesnt work
{
System.out.println(str)
str.bufReader.readLine();
}

Any ideas anyone??

LeeBee

Last edited by leebee : 07-18-2007 at 04:55 PM. Reason: worded wrong
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-18-2007, 05:11 PM
Member
 
Join Date: Jul 2007
Posts: 17
sathish_2111 is on a distinguished road
use while(str != null)
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
do...while loop eva New To Java 16 01-31-2008 08:44 AM
while loop michcio New To Java 5 01-27-2008 02:56 AM
can you help me with this for loop? java_fun2007 New To Java 6 12-22-2007 12:20 PM
A loop that doesn't loop MichYer New To Java 2 07-30-2007 10:44 AM
Loop Help HeavyD New To Java 5 07-10-2007 03:26 PM


All times are GMT +3. The time now is 10:31 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org