Read file one more time.

pls tell me reason why the second loop it does not show any thing.
file input like: 1 7 f d
here the code
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class ReadFile
     public static void main(String args[]) throws  IOException
          FileReader in = new FileReader(new File("input.txt"));
          int c;
          System.out.print("Read first :");
          while((c = in.read()) != -1)
               System.out.print((char)c + " ");
          System.out.print("\nRead second:");
          while((c = in.read()) != -1)
               System.out.print((char)c + " ");
          in.close();
}Edited by: how_i_do on Oct 12, 2009 8:26 AM

here is my code
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
public class ReadFile
     private   FileReader in;
     public ReadFile()
      try{
           in = new FileReader(new File("input.txt"));
           }catch(IOException e)
                e.fillInStackTrace();
     public void readFirst() throws IOException
          int c;
          System.out.print("Read first :");
          while((c = in.read()) != -1)
               System.out.print((char)c + " ");
          in.close();
     public  void readSecond() throws IOException
          int c;
          System.out.print("Read first :");
          while((c = in.read()) != -1)
               System.out.print((char)c + " ");
          in.close();
     public static void main(String args[]) throws  IOException
          ReadFile readfile = new ReadFile();
               readfile.readFirst();
               readfile.readSecond();
}

Similar Messages

  • How can I access my files one more time?

    I am using OS X 10.4 on PowerBook G4.
    I did something very wrong. I right clicked on my actual hard drive then “Get info” then I tried to do some changes. On the very bottom of that menu I saw an option calls Access, so I changed it to admin then pressed enter and suddenly everything is gone. Now when I turn my laptop ON, all I see is Mac’s beautiful blue background and my mouse pointer and nothing else.
    Could anyone help me please?
    Thanks
    PowerBook G4 Mac OS X (10.4.8)
    PowerBook G4   Mac OS X (10.4.8)  

    Follow the first set of instructions in this FAQ.
    (17150)

  • How can i Delete all foto from my iphone and after some time get them one more time on it but not as a new album :)?

    How can i Delete all foto from my iphone and after some time get them one more time on it but not as a new album, i want them in the camera roll ?

    How can I delete EVERY THING off my Mac and have it like new?
    Boot from the software install DVD and do an "erase and install" when prompted.

  • [svn] 1594: Update the warning message when outbound throttle policy of REPLACE is used one more time .

    Revision: 1594
    Author: [email protected]
    Date: 2008-05-07 11:10:27 -0700 (Wed, 07 May 2008)
    Log Message:
    Update the warning message when outbound throttle policy of REPLACE is used one more time. Now the warning says this. . .
    Throttle outbound policy 'REPLACE' found on message destination 'MESSAGE_DESTINATION'. The 'REPLACE' throttle outbound policy has been deprecated. Please remove it from your configuration file.
    Modified Paths:
    blazeds/branches/3.0.x/modules/core/src/java/flex/messaging/MessageDestination.java

    hamish72 wrote:
    You can still download as much as you can only a lot slower during peak times off peak will not be restricted.
    Thanks for this explanation. I had taken it that it was at all times.
    As I said in the first place it will be great if they throttle me to 1Mb at peak times as it will be better half the time than I am getting anyway!!!!!!!!!
    hamish72 wrote:
    Have you chased up why your line is so bad, long way from exchange and so on
    Posting your router stats may get advice from someone
    enter for homehub for other routers will differ
    192.168.1.254 in browser click A to Z top right
    then ADSL enter pas and click MORE DETAIL
    POST RESULTS
    Also post results of test at ( best done from master test socket)
    http://speedtester.bt.com/
    Connection Information
    Line state
    Connected
    Connection time
    6 days, 11:57:55
    Downstream
    5,760 Kbps
    Upstream
    448 Kbps
    ADSL Settings
    VPI/VCI
    0/38
    Type
    PPPoA
    Modulation
    G.992.1 Annex A
    Latency type
    Interleaved
    Noise margin (Down/Up)
    5.7 dB / 21.0 dB
    Line attenuation (Down/Up)
    44.6 dB / 24.0 dB
    Output power (Down/Up)
    8.9 dBm / 1.6 dBm
    Loss of Framing (Local/Remote)
    0 / 0
    Loss of Signal (Local/Remote)
    0 / 0
    Loss of Power (Local/Remote)
    0 / 0
    FEC Errors (Down/Up)
    25279 / 134
    CRC Errors (Down/Up)
    700 / 196
    HEC Errors (Down/Up)
    5427 / 142
    Error Seconds (Local/Remote)
    477 / 102

  • I have to pay one more time!

    Hi!
    I have bought the album called "Disc-Overy" from Tinie Tempah. I did reset my iPhone and set it up as a new iPhone. I also synced with another iTunes library. Now iTunes ask me to pay for the album again! I aldo bought the ringtone called "Levels" of Avicii and I have to pay for that one more time too!
    And when it comes to app. I downloaded iCopter from appstore. I bought the pro version in-app and when i try to do the same again with this newly setup iPhone I also have to pay for this one more time! Please help me!

    I've had the same problem with the albums when switching iPhones.
    Usually when you click purchase in the app- or itunes store it will start the download but will then give you the message: "You've already bought this item, do you want to download it again?". In that case you won't be charged twice, but in my expirience that won't show up untill you're willing to make the purchase.
    Best thing would be to just sync the new iPhone with iTunes if that already contains your purchased apps, books and music.

  • HT201272 I bought PDF expert $9.99 for my ipad. When I tried to download to my iphone 5 , they tried to charge me one more time. Any solution?

    I bought PDF expert $9.99 for my ipad. When I tried to download to my iphone 5 , they tried to charge me one more time. Any solution?

    There are two separate PDF Expert versions on App Store: PDF Expert for iPad and PDF Expert for iPhone. PDF Expert for iPad differs from iPhone version and both versions are not free.

  • How to download one more time the purchased content?

    I purchased yesterday the OST of Fast Five, and unexpectedly I deleted it from my Mac. How to access it one more time?

    If you are in a country where you can re-download music, and if it is still in the store, then it should show under the Purchased link under Quicklinks on the right-hand side of the iTunes store home page on your computer's iTunes for re-downloading. If you aren't in a country where music can currently be re-downloaded then you will need to try contacting iTunes Support and see if they will grant you a re-download : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • My iphone has broken and I had songs that I had purchased on there that I had not yet backed up on my computer. apparently you can download the tracks one more time free of charge does anybody know how??

    how do you re download tracks that are on a broken iphone???

    apparently you can download the tracks one more time free of charge does anybody know how??"
    Not true.  You get one and only one download.
    In some instances, itunes has allowed another download to a few.  This is not the norm.
    You can try contacting itunes support and asking for an exception, but they are under no obligation to allow.
    Hope all goes well.
    http://www.apple.com/support/itunes

  • HT5552 Apple decline payment method for apple ID (credit card VISA) after 2 weeks of active using it. And did it one more time

    Few mothes ago I registered my Apple ID.Payment method chose credit card VISA. It allowed me to make purchases and download apps. But after 2 weeks it said that my payment method was declined and I have to register and pay 1$ once again. So I registered one more time with the same credit card, made several downloads and purchases and after 2-3 weeks the situation was the same. My payment method was declined. What is the reason?

    Kateryna Malykhina wrote:
    ... My payment method was declined. What is the reason?
    As this is a User to User forum no one here would know...
    You need to Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • Big problem with my macbook pro 2009 - 3 motherboard changed at applestore Velisy and one more time it is for nothing.... ! Apple says you're not lucky?????

    3 motherboard i have changed at applestore Velisy and one more time it is for nothing.... !
    Apple says you're not lucky????? What can i do

    A sorry it 's macbook pro unibody from 2011

  • One more time...PSE 12 RAW Files...

    My Camera is a FUJIFILM FINEPIX HS35EXR and 12 cannot read it's raw  files. Are there any "updates" for the RAW plugin already included in the software, or am I stuck with a  free a standing converter?

    Please, follow your other post :
    http://forums.adobe.com/thread/1379652?tstart=0

  • One more time - problems with fans

    I realize this is but one of hundreds or possibly thousands of cases of Mac users being plagued by fan noise problems, but to me it has been a long and extremely frustrating saga. I have been a Mac user since the very beginning, through different versions of Macs and iMacs, and this is the first time I ever refer to a Macintosh as a "piece of junk."
    I bought my iMac G5 in August 2005, a 20-inch ALS with 250 GB hard drive and 512 MB RAM. It worked perfectly until January this year, when all of sudden it shut down by itself. Freaked me out completely. Turned out to be power supply problem (EMC 2056) which Apple never informed me about.
    I brought it to a repair shop that fixed the intermittent shut-down problem. I also added 1GB memory. But then the fans started to go berserk. Before the power supply problem, I only heard the fans whenever I used a large program like Photoshop. For the most part, it was a very quiet machine. After the power supply was replaced, within minutes of turning the iMac on, I could hear the fans spinning faster and faster, stabilizing at around 4400 rpm and did not stop spinning until I put the iMac to sleep or turned it off, regardless of CPU usage or software being used.
    I checked the discussions at this forum (over 500 posts, no real answer) and did every "voodoo trick" suggested: I reset the SMU dozens of time, cleaned the inside of the iMac and around the fan area, did apple hardware test (everything was fine), monitored temperature and activity with XRG (average CPU at 160F, hard drive at 113F), cleaned out caches, tested for corrupt preferences, re-installed the original OS 10.4 (which only made the fans louder), upgraded it back to OS 10.4.9. I also removed the additional 1 GB memory, thinking it might be a bad piece. It didn't help.
    Finally, I requested fan replacement from Apple and got them. I installed them last Sunday and now the problem is even worse! Within SECONDS of turning it on, the CPU T- Dio soars to around 170F, even while the machine is still stone cold to the touch. The hard drive temperature now averages at 117F, CPU fan is never below 4000 rpm (4400 rpm 98% of the time), even at 5-8% CPU usage.
    The fans themselves are much quieter because they're brand new. But you can still hear the hums and whirs and it drives me nuts. More seriously, my iMac is now narcoleptic. If I use it too long (a few hours on a stretch) it will put itself to sleep, apparently because it thinks it is overheated. And when I use Photoshop or Illustrator, the awake time is even shorter. Depending on the outside temperature, at the most I can only use them for about an hour at a time. Two days ago we had heat wave, and even with the air conditioner running full blast in my study, the iMac kept falling asleep within minutes of using Illustrator.
    Right now I am using TextEdit and no other program is running. Uptime is 59 minutes, average CPU 9.6%. CPU T-Dio is at 168.8F, hard drive 117.5F, CPU fan at 4400 rpm. I am out of ideas and before I do something drastic to this machine, if anyone knows what's going on with my iMac (I know every case is different), please help!
    iMacG5 ECM 2056   Mac OS X (10.4.9)   20"/2.0GHz Power PC/1.5GB DDR SDRAM/250GB
    iMacG5 ECM 2056   Mac OS X (10.4.9)   20"/2.0GHz Power PC/1.5GB DDR SDRAM/250GB

    I do not have the solution... but the same problem with a nice iMac G5 purchased in July 2005.
    My Mac operated very silently untill 6 month ago;problem MAY ( I am not sure) have started when I upgraded to 10.4.10 ; even with few applications and low CPU usage (80% or more inactive), it seems that I have the following regrettable chain of events;
    ==> the CPU temperature is quite high ( 60°c to 72°c most of the time, ie 140-160 °F)
    ==> resulting in fan turning at high speed ( 2.000 for CPU and system, 2500 for HD), and changing speed all the time
    ==> resulting in a noisy computer
    I am SURE this was not the case 6 month ago, and I suspect it is linked to my upgrade to 10.4.10.
    I did all sorts of reinstall, authorization repair, SMU reset, fan clean-up with no sucess.
    iMac G5 (2005)   Mac OS X (10.4.10)   POwerbook G4 Titanium (2001)

  • I'll ask this one more time...

    I've asked. Can't seem to get any real answer. I'm using the Adobe CC cloud storage. It's deleting my files indiscriminately without me even knowing. Who knows what I’ve lost along the way. It’s an absolute disgrace. I’ve lost time, money and lost face with my customers. Does anyone at Adobe actually care about this known issue??? Disgraceful.

    Sounds horrible :-(
    But apart from the grief and annoyance, in order to dig deeper into the possible problem, it's crucial to provide some more information about the exact situation and your actions. Because -as you might have guessed- it probably won't be a general issue with a generic solution or logical explanation.
    Describe the situation a bit more. It won't bring your files back, but it will help the Adobe developers to take a better look at it and perhaps offer a soltion to prevent it from happening again.

  • I can tell the differnce when listening to "One More Time" by Daft Punk...

    ...The 356kb version when compared to a 128kb version I had. The electronic sounds sound a lot more crisper then on the other one...not to mention it doesn't make a fuzzy sound when I turn it up high on the iPod...but then again, like I said in another thread, I also compared "Smile" by Lily Allen and they sounded very much the same. I'm also using noise-cancelling headphones and a brand new audio card so it should be easy to hear the difference when played...to tell you the truth, it's better on a few songs but sound very much the same on other songs...it depends on what the song is and what type of audio equipment you have.
      Windows XP  

    If the errors are consistent across OS (ie LiveCD, Windows?)  then your motherboard is most likely on it's way out and needs replacing
    You could try removing the motherboard cell battery and doing the "classic capacitor flush" again. Leaving the battery out for a period of time generally has the same effect and in "classic" IT style fixes numerous woes... have you tried a different cable?
    If, after replacing the battery, the problem has disappeared I would still treat the hardware as suspect and have it replaced as soon as possible. These sorts of brain farts typically reappear sooner rather than later

  • ONe more time - Java program Help -

    HI. I need to know what the code would be to print the Nodes. I simply can't figure it out.I'm not allowed to change anything or add anything. I just have to fill in the methods and make the ListSort work as it is. I can't figure out how to print each node so the out put looks like this:
    *12 2 10 5*
    *12 2 10 5*
    Eventually I have to have to program sort them but I can probably figure it out if I can just print them. ANy help? I have posted before but with no luck. GOod advice its just i can't find out the code to write in the printLIst and insertNodeAtBeginning that will get the nodes to print.
    * implements various methods related to manipulating a singly-linked list
    public class LinkedList
    private Node firstNode = null;
    * prints all the elements of the list in order on one line, separated by s
    paces
    * puts a line of dashes above and below the printed list
    public void printList()
    System.out.println("----------");
    Node currentNode = firstNode;
    System.out.println("----------");
    * inserts a new node into the list at the beginning of the list
    public void insertNodeAtBeginning(Node newNode)
    // quick error checking
    if (newNode == null)
    return;
    // TODO: insert newNode into the beginning of the list
    * inserts the newNode into the list just before the first node that
    * has a larger value than newNode; if the list is empty or if newNode
    * has the smallest value, then newNode will be inserted at the beginning
    * of the list; if newNode has the largest value in the list, then it
    * should be inserted at the end of the list
    public void insertNodeInAscendingOrder(Node newNode)
    // quick error checking
    if (newNode == null)
    return;
    // TODO: insert newNode in the right place in the list
    * remove the first node in the list and return it. if there are no
    * elements in the list, then return null
    public Node removeFirstNode()
    return firstNode;// TODO: remove the first element in the list and return
    it, or
    // return null if the list is empty
    * use recursion to sort the given list in ascending order
    public static void recursiveListSort(LinkedList list)
    // quick error checking
    if (list == null)
    return;
    // TODO: use recursion to sort the list
    Next file:
    public class ListSort {
    * @param args
    public static void main(String[] args) {
    LinkedList list = new LinkedList();
    list.insertNodeAtBeginning(new Node(5));
    list.insertNodeAtBeginning(new Node(10));
    list.insertNodeAtBeginning(new Node(2));
    list.insertNodeAtBeginning(new Node(12));
    list.printList();
    LinkedList.recursiveListSort(list);
    list.printList();
    Next File:
    public class Node
    private int value;
    public Node next = null;
    public Node(int newValue)
    value = newValue;
    public int getValue()
    return value;
    }

    You did receive good advice previously and would do well to study it and search the forum as well. One other thing to help you get advice is to post your code so it is readable without hurting the eyes. So please use code tags so that your code will be well-formatted and readable. To do this, place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
    [code]
    // your code block goes here.
    [/code]

Maybe you are looking for

  • WINDOWS 8.0, UPDATED TO 8.1--SOLUTIONS FOR DELETING??

    I HAVE A HP ALL IN ONE W/WINDOWS 8.0, RECENTLY UPDATED TO 8.1. THINKING OF POSSIBLY UNINSTALLING 8.1 IF ITS EVEN POSSIBLE? I AM NOT COMPUTER SAVVY AT ALL.  ANY ADVICE ?  THANKS! This question was solved. View Solution.

  • File icon stuck in Mavericks Finder toolbar

    I just upgraded to Mavericks and now I have an InDesign file icon stuck in the a Finder window toolbar. The file and InDesign are both closed. If I click on the icon InDesign will launch and open the file. The file is in a Dropbox folder and not on t

  • Changes to Payroll Recon report in ECC 6.0

    The payroll recon report delivered with ECC 6.0 is very different from the one in 4.6C and we need the same report as 4.6C. SAP claims in release notes this is supported but we cannot make it work. Has anyone worked through this? Thanks

  • CONVERTTOCLOB procedure

    I'm new to using this procedure. There is a ConvertToClob procedure in Oracle that I want to use. I have a BLOB named BLOB_CONTENT already being inserted into my database table named "xmltest2" I want to be able to either 1) Extract the Blob_content

  • Increase Target Rate on Veristand

    Hello, I am a novice user of Veristand. I am trying to make a control feedback using a compactRIO :  RT NI cRIO 9024 Chassis cRIO 9113 Modules 9220 and 9263. I am using Veristand with a compiled model from Simulink to make my control. I want to be ab