How can i rewrite this code into java?

How can i rewrite this code into a java that has a return value?
this code is written in vb6
Private Function IsOdd(pintNumberIn) As Boolean
    If (pintNumberIn Mod 2) = 0 Then
        IsOdd = False
    Else
        IsOdd = True
    End If
End Function   
Private Sub cmdTryIt_Click()
          Dim intNumIn  As Integer
          Dim blnNumIsOdd     As Boolean
          intNumIn = Val(InputBox("Enter a number:", "IsOdd Test"))
          blnNumIsOdd = IsOdd(intNumIn)
          If blnNumIsOdd Then
       Print "The number that you entered is odd."
    Else
       Print "The number that you entered is not odd."
    End If
End Sub

873221 wrote:
I'm sorry I'am New to Java.Are you new to communication? You don't have to know anything at all about Java to know that "I have an error," doesn't say anything useful.
I'm just trying to get you to think about what your post actually says, and what others will take from it.
what does this error mean? what code should i replace and add? thanks for all response
C:\EvenOdd.java:31: isOdd(int) in EvenOdd cannot be applied to ()
isOdd()=true;
^
C:\EvenOdd.java:35: isOdd(int) in EvenOdd cannot be applied to ()
isOdd()=false;
^
2 errors
Telling you "what code to change it to" will not help you at all. You need to learn Java, read the error message, and think about what it says.
It's telling you exactly what is wrong. At line 31 of EvenOdd.java, you're calling isOdd(), with no arguments, but the isOdd() method requires an int argument. If you stop ant think about it, that should make perfect sense. How can you ask "is it odd?" without specifying what "it" is?
So what is this all about? Is this homework? You googled for even odd, found a solution in some other language, and now you're just trying to translate it to Java rather than actually learning Java well enough to simply write this trivial code yourself?

Similar Messages

  • How can i rewrite this code

    i have tried to rewrite this code but keep getting errors. ive read loads of tutorials on actionperformed and mouseclicked i just need som1 to point me in the right direction
    heres the code
    public boolean mouseUp(Event e, int x, int y){
    if (y == 0)
    swit = true;
    return true;
    //else
    if (pics[getMC(x,y)].getID() > rw*col/2){
      return true;}
    if (0 == track)
    card1 = pics[getMC(x,y)];
    start = new Date();
    etime.start();
    track = 2;
    stat = "pic again";
    repaint();
    return true;
    if (1 == track){
      card1 = pics[getMC(x,y)];
      track = 2;
      stat = "pick again";
      repaint();
      return true;
    else if (2 == track)
           if (card1 == pics[getMC(x,y)]) return true;
             card2 = pics[getMC(x,y)];
             track = 3;
             attempts++;
             if (card1.getID() == card2.getID())
              stat = "well done";
                matched++;
                if (rw*col/2 == matched)
                 stat = "finished";
                   etime = null;
             else
              stat = "Try Again";
             repaint();
             return true;
          else
           return false;
       }

    Hi,
    Do you want your code to listen to different Mouse events? and what other events?
    ex:
    copy the content of the below link and run the application
    http://java.sun.com/docs/books/tutorial/uiswing/examples/events/MouseEventDemoProject/src/events/MouseEventDemo.java
    http://java.sun.com/docs/books/tutorial/uiswing/examples/events/MouseEventDemoProject/src/events/BlankArea.java
    If you have any problem with the code; please let us know
    Regards,
    Alan Mehio
    London,UK

  • How can I add advertisement code into flash game?

    hi mates,
    just want to ask about loading advertisement code!
    How do you add the advertisement code (adsense) into flash games??
    my site Funny Games have over 5k games but they are getting from others sites thus I have no original files. How can I add more code into the current files?

    Unless the games were pre-made to allow you to specify some variables in the page code or some external file, you won't be having any luck... you cannot add code to the games unless you have the source files, which you apparently don't have.

  • How can I rewrite this update stmt to improve its poor performance?

    Hi,
    I have the following update stmt that runs for over 6 hours. Here is the SQL and its plan:
                UPDATE TABLE1
                     SET mainveh = 'Y'
                 WHERE (comp#,polnum,a8dtef,a8deef,a8dtac,
                        DECODE(everif,'Y',10000,0)+auunit*100+vrcdsq)
                    IN (SELECT comp#,polnum,a8dtef,a8deef,a8dtac,
                               MAX(DECODE(everif,'Y',10000,0)+auunit*100+vrcdsq)
                          FROM TABLE1
                         GROUP BY comp#,polnum,a8dtef,a8deef,a8dtac);
    PLAN_TABLE_OUTPUT
    | Id  | Operation             | Name     | Rows  | Bytes |TempSpc| Cost (%CPU)|
    |   0 | UPDATE STATEMENT      |          |     1 |   108 |       |   798K  (1)|
    |   1 |  UPDATE               | TABLE1   |       |       |       |            |
    |   2 |   HASH JOIN           |          |     1 |   108 |  1079M|   798K  (1)|
    |   3 |    TABLE ACCESS FULL  | TABLE1   |    21M|   834M|       |   224K  (1)|
    |   4 |    VIEW               | VW_NSO_1 |    21M|  1364M|       |   440K  (1)|
    |   5 |     SORT GROUP BY     |          |    21M|   794M|  2453M|   440K  (1)|
    |   6 |      TABLE ACCESS FULL| TABLE1   |    21M|   794M|       |   224K  (1)|I'm using Oracle 10.2.0.3. The TABLE1 table has 21 million rows. The update stmt will update about 15 million rows. How can I rewrite this update stmt so it'll perform better? There is a primary index on all the columns selected in the subquery. That is the only index on TABLE1.
    Thank you!
    Edited by: user6053424 on Jul 21, 2010 6:59 AM

    Hi,
    Thank you for your suggestions. There is an index on the columns in the group by, it is the PK index on TABLE1. I'm suspecting that due to the amount of data to update, the optimizer decided that full table scan is cheaper than index scan. I'm very interested in the GTT idea, but still need some help if I decide to create a GTT from the subquery, because if I just do this:
    create global temporary table table1_tmp
    on commit preserve rows
    as SELECT comp#,polnum,a8dtef,a8deef,a8dtac,
               MAX(DECODE(everif,'Y',10000,0)+auunit*100+vrcdsq)
          FROM TABLE1
         GROUP BY comp#,polnum,a8dtef,a8deef,a8dtac;then the original update stmt still has the DECODE and such in it, I'm not sure how much benefit that'll do to us:
    UPDATE TABLE1
                     SET mainveh = 'Y'
                 WHERE (comp#,polnum,a8dtef,a8deef,a8dtac,
                        DECODE(everif,'Y',10000,0)+auunit*100+vrcdsq)
                    IN (SELECT comp#,polnum,a8dtef,a8deef,a8dtac,???
                          FROM TABLE1);Your input is greatly appreciated! Thanks!

  • How  can i run this code correctly?

    hello, everybody:
        when  i run the code, i found that it dons't work,so ,i  hope somebody can help me!
        the Ball class is this :
        package {
        import flash.display.Sprite;
        [SWF(width = "550", height = "400")]
        public class Ball extends Sprite {
            private var radius:Number;
            private var color:uint;
            private var vx:Number;
            private var vy:Number;
            public function Ball(radius:Number=40, color:uint=0xff9900,
            vx:Number =0, vy:Number =0) {
                this.radius= radius;
                this.color = color;
                this.vx = vx;
                this.vy = vy;
                init();
            private function init():void {
                graphics.beginFill(color);
                graphics.drawCircle(0,0,radius);
                graphics.endFill();
    and the Chain class code is :
    package {
        import flash.display.Sprite;
        import flash.events.Event;
        [SWF(width = "550", height = "400")]
        public class Chain extends Sprite {
            private var ball0:Ball;
            private var ball1:Ball;
            private var ball2:Ball;
            private var spring:Number = 0.1;
            private var friction:Number = 0.8;
            private var gravity:Number = 5;
            //private var vx:Number =0;
            //private var vy:Number = 0;
            public function Chain() {
                init();
            public function init():void {
                ball0  = new Ball(20);
                addChild(ball0);
                ball1 = new Ball(20);
                addChild(ball1);
                ball2 = new Ball(20);
                addChild(ball2);
                addEventListener(Event.ENTER_FRAME, onEnterFrame);
            private function onEnterFrame(event:Event):void {
                moveBall(ball0, mouseX, mouseY);
                moveBall(ball1, ball0.x, ball0.y);
                moveBall(ball2, ball1.x, ball1.y);
                graphics.clear();
                graphics.lineStyle(1);
                graphics.moveTo(mouseX, mouseY);
                graphics.lineTo(ball0.x, ball0.y);
                graphics.lineTo(ball1.x, ball1.y);
                graphics.lineTo(ball2.x, ball2.y);
            private function moveBall(ball:Ball,
                                      targetX:Number,
                                      targetY:Number):void {
                ball.vx += (targetX - ball.x) * spring;
                ball.vy += (targetY - ball.y) * spring;
                ball.vy += gravity;
                ball.vx *= friction;
                ball.vy *= friction;
                ball.x += vx;
                ball.y += vy;
    thanks every body's help!

    ok, thanks for your reply ! I run this code in the Flex builder 3!and the Ball class and the Chain class are all in the same AS project!
      and i changed the ball.pv property as public in the Ball class, and  the Chain class has no wrong syntactic analysis,but the AS code don't run.so this is the problem.
    2010-04-21
    Fang
    发件人: Ned Murphy <[email protected]>
    发送时间: 2010-04-20 23:01
    主 题: how  can i run this code correctly?
    收件人: fang alvin <[email protected]>
    I don't see that the Ball class has a pv property, or that you even try to access a pv property in the Chain class.  All of the properties in your Ball class are declared as private, so you probably cannot access them directly.  They would need to be public.  Also, I still don't see where you import Ball in the chain class such that it can use it.

  • How can i know how to redeem the code? how can i get this code?

    how can i know how to redeem the code? how can i get this code? please i need you help
    <Email Edited by Host>

    You are trying to create a new Apple ID? You don't have one yet? Is that correct?
    If so, then see this article on how to creat your Apple ID - and make up a password for it. Remember to write it down immediately.
    http://support.apple.com/en-us/HT203993

  • I forgot the codeslot of my ipod. How can I delete this code?

    I forgot the codeslot of my ipod. How can I delete this code? Can anybody help help me? I'm sorry for the bad English.

    Connect it to iTunes and Restore it.

  • How can i merge javafx code and java fxml code in a single project

    how can i merge javafx code and java fxml code in a single project.
    Please let me Know as soon as possible.

    Everything that it is possible to retrieve from a class file can be deduced from the class file definition.
    http://java.sun.com/docs/books/vmspec/2nd-edition/html/ClassFile.doc.html
    Sylvia.

  • How can i improve this code ?

    DATA: t_bkpf TYPE bkpf.
    DATA: t_bseg type bseg_t.
    DATA: wa_bseg like line of t_bseg.
    select * from bkpf into t_bkpf where document type ='KZ' and bldat in s_bldat.
    select single * from bseg into wa_bseg where belnr = t_bkpf-belnr.
    append wa_bseg to t_bseg.
    endselect.
    loop at t_bseg into wa_bseg.
      at new belnr.
         if wa_bseg-koart EQ 'K'.
            // pick vendor wrbtr
         else
           // pick other line item's wrbtr
         endif.
      endat.
    endloop.
    i am guessing my select statements arnt efficient performance wise, secondly in the loop when i use  'at new belnr' it aint showing my any values  whereas i get all the vendors(KOART EQ 'K') when i dont use 'at new belnr' .
    why is this so and how can i make the code efficient ?
    Thanks..
    Shehryar

    Hi,
    1.Dont read all the fields from the table unless it is required in your program.
    This will tremendously improve your performance.
    2.Make use of the key fields of the table wherever possible
    In your scenario you could use the fields BUKRS,BELNR,GJAHR of the table BKPF in the WHERE Clause rather than
    other fields.This will improve your performance a lot..
    3.As BSEG is a cluster table it will cause performance problem in most cases.So try to read
    the required fields from it rather than reading all the fields.Again Make use of the key fields in the WHERE Clause
    here too to improve the performance..
    4.Remove SELECT..ENDSELECT and replace it with FOR ALL ENTRIES to improve the performance.
    Cheers,
    Abdul Hakim
    Mark all useful answers..

  • How can I view native code in Java?

    I am trying to write a program to find the log of a number. I looked for Java's implementation in Math.log(x), but it is a native method. How can I see the code in the other language(C or C++)? I have looked at JNI, but i don't think it is what i need. Any Ideas??

    Before the Mustang release, i don't believe sun
    released the source code to the native binaries.Actually, I'm pretty sure they did, but I don't know off the top of my head where to get it. You'd have to search.

  • I just bought a new mac. I have Acrobat pro on my windows PC. How can I reinstall this program into my new mac?

    I just bought a new mac. I currently have acrobat pro X on my Windows pc that I don't intend to use any more. How can I reinstall this into my mac?

    Hi George,
    Platform swap is available only for currently shipping version products( in this case Acrobat 11)
    Please check Adobe's Platform swap policy at: Order product | Platform, language swap
    Regards,
    Rave

  • I have 8mm family footage now on a DVD how can I import this material into imovie

    Can anyone help I have old 8mm footage of the family which is now on a DVD how can I import this onto imovie?

    You need to convert the DVD .VOB files. This can be done with Apps like Handbrake or I prefer MPEG Steamclip.
    Basically what you do is insert the DVD into the drive. If DVD Player opens, quit the player. Then double click the DVD on the desktop. There you will find a folder called Video_TS. The .VOB files are there. You do not need the Audio_TS files or Folder.  So what ever App you use, point them to that Folder and convert them to highest quality conversion.
    One thing to point out though about MPEG Streamclip, you need to have Quicktime 7 installed and additionally you need a file called QuickTime MPEG-2 Playback Component. Make sure you read about it at the Squared 5 website under "Requirements". It may sound like alot of work, but once you set it up MPEG Streamclips works nice.
    Hope that gets you started.
    Additionally, if you have another machine around with Leopard or earlier, you may already have the MPEG-2 Playback Component. It would be located in /Library/Quicktime folder.

  • How do I rewrite current code for java 1.3

    I'm using the code below that is written for java 1.4. I have been told that the company can not push JRE 1.4 to the company, and that I need to write my code for java 1.3. I'm using org.w3c.dom for my create xml, etc.
    Is there a java 1.3 option to the 1.4? Any help would be very appreciated.
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.util.List;
    import java.io.*;
    import java.util.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.dom.*;
    import javax.xml.transform.stream.*;
    import org.w3c.dom.*;
    public class Sametime extends JFrame implements ActionListener {
        private int indentation = -1;
        JPanel panel = new JPanel();
        JTextArea jta = new JTextArea(
        //Instructions for user
        "For a successful buddy list migration do the following:\n"
        + "1. Save your current Sametime Buddy List to your PC.\n   "
        + "The default location should be: C:/Program Files/Lotus/Sametime Client.\n"
        + "  A. Open the Sametime Client.\n"
        + "  B. Click on People\n"
        + "  C. Click on Save List.\n"
        + "  D. Save as your first.last.dat\n"
        + "     Ex. john.doe.dat\n"
        + "NOTE: If you have AOL contacts in your Sametime buddy list they will not be migrated.\n");
        JButton browse = new JButton("Continue");
        JButton exit = new JButton("Exit");
        public Sametime() {
            super("Sametime Buddy List Migration");
            setSize(610, 245);
            Container c = this.getContentPane();
            c.add(panel);
            browse.addActionListener(this);
            exit.addActionListener(this);
            panel.add(jta);
            panel.add(browse);
            panel.add(exit);
            jta.setEditable(false);
            setLookAndFeel();
            setVisible(true);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        } //end Sametime
        public class DATFilter extends javax.swing.filechooser.FileFilter {
            public boolean accept(File f) {
                //if it is a directory -- we want to show it so return true.
                if (f.isDirectory())
                    return true;
                String extension = getExtension(f);//get the extension of the file
                //check to see if the extension is equal to "dat"
                if ((extension.equals("dat")))
                    return true;
                //default -- fall through. False is return on all
                //occasions except:
                //a) the file is a directory
                //b) the file's extension is what we are looking for.
                return false;
            }//end accept
            public String getDescription() {
                return "dat files";
            }//end getDescription
             * Method to get the extension of the file, in lowercase
            private String getExtension(File f) {
                String s = f.getName();
                int i = s.lastIndexOf('.');
                if (i > 0 &&  i < s.length() - 1)
                    return s.substring(i+1).toLowerCase();
                return "";
            }//end getExtension
        }//end class DATFilter
        public void actionPerformed(ActionEvent e) {
            //Default Location for JFileChooser search
            String error = "The file selected is not a .dat file!\n"
            + "Please select your recently saved .dat file and try again.";
            JFileChooser fc = new JFileChooser("/Program Files/Lotus/Sametime Client");
            fc.setFileFilter(new DATFilter());
            fc.setFileSelectionMode( JFileChooser.FILES_ONLY);
            String user = System.getProperty("user.name");// finds who the current user is
            if (e.getSource() == browse) {
                int returnVal = fc.showSaveDialog(Sametime.this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    //if (fc.getSelectedFile().getName().equals(".dat")){
                    if (fc.getSelectedFile().getName().endsWith(".dat")){ // checks to see if selected file is .dat
                    }else{
                        JOptionPane.showMessageDialog(null, error, "Wrong File", JOptionPane.ERROR_MESSAGE);
                        return;
                    }//end else
                    try {
                        String[] contactArray = parseDatFile(fc.getSelectedFile());
                        Document document = createXMLDocument(contactArray);
                        saveToXMLFile(
                        document,
                        new File(
                        "C:/Documents and Settings/" + user +"/My Documents/OLCS/",// looks for directory for list
                        "contacts-list_migration.ctt"));
                    } catch (Exception exc) {
                        File f = new File("C:/Documents and Settings/" + user +"/My Documents/OLCS/");// setting directory for list if not there
                        boolean yes = true;
                        yes = f.mkdir();// creating directory
                        try {
                            String[] contactArray = parseDatFile(fc.getSelectedFile());
                            Document document = createXMLDocument(contactArray);
                            saveToXMLFile(
                            document,
                            new File(
                            "C:/Documents and Settings/" + user +"/My Documents/OLCS/",// used only if the directory didn't exist
                            "contacts-list_migration.ctt"));
                            //exc.printStackTrace();// not sure if this is needed?
                        } catch (Exception exc1) {
                            exc1.printStackTrace();
                        }//end inner catch
                    }// end catch
                }// end if
                if(returnVal==JFileChooser.CANCEL_OPTION){
                    String Warning = "You did not migrate your Sametime buddy list at this time.";
                    JOptionPane.showMessageDialog(null, Warning, "Migration Canceled", JOptionPane.WARNING_MESSAGE);
                    return;
                }else{
                    String thankyou = "Thank You for Migrating your Sametime buddy list to OLCS"
                    + "\nYour new OLCS buddy list has been saved to:"
                    + "\nC:/Documents and Settings/" + user +"/My Documents/OLCS"
                    + "\n as: Contact-List_migration.ctt"
                    + "\n\n To be able to use Contact-List_migration.ctt for Windows Messenger:"
                    + "\n1. Log into Windows Messenger."
                    + "\n2. Click on File"
                    + "\n3. Click on 'Import Contacts from a Saved File...'"
                    + "\n4. Open OLCS in My Documents"
                    + "\n5. Click on 'Contact-list_migration.ctt'"
                    + "\n6. Click Open to import the list."
                    + "\n   A window will pop up confirming that you want to add all of the contacts"
                    + "\n   Click 'yes'"
                    + "\n   Your buddy list is ready to be used.";
                    JOptionPane.showMessageDialog(null, thankyou, "Migration Completed", JOptionPane.INFORMATION_MESSAGE);//Change this when defualt directory is known.
                }//end if else statement
            } //end if
            System.exit( 0 );
            if (e.getSource() == exit) {
                System.exit( 0 );
            } //end if
        } //end actionPerformed
        String[] parseDatFile(File datFile)
        throws Exception    {
            List list = new ArrayList();
            BufferedReader br = new BufferedReader(new FileReader(datFile));
            String line;
            while ((line = br.readLine()) != null) {
                line = line.trim();
                if (line.indexOf("U") != 0)
                    continue;
                int p = line.indexOf("::");
                if (p == -1)
                    continue;
                line = line.substring(p + 2).trim();
                if (line.indexOf("AOL") == 0)
                    continue;
                p = line.indexOf(",");
                if (p != -1)
                    line = line.substring(0, p);
                line = line.trim() + "@mci.com";
                if (list.indexOf(line) == -1)
                    list.add(line);
            }//end while
            br.close();
            String[] contactArray = new String[list.size()];
            list.toArray(contactArray);
            return contactArray;
        }// end String
        // setting up the XML file
        Document createXMLDocument(String[] contactArray) throws Exception {
            DocumentBuilderFactory dBF = DocumentBuilderFactory.newInstance();
            DocumentBuilder builder = dBF.newDocumentBuilder();
            DOMImplementation domImpl = builder.getDOMImplementation();
            Document document = domImpl.createDocument(null, "messenger", null);
            Element root = document.getDocumentElement();
            Element svcElm = document.createElement("service");
            Element clElm = document.createElement("contactlist");
            svcElm.setAttribute("name", "Microsoft RTC Instant Messaging");
            svcElm.appendChild(clElm);
            root.appendChild(svcElm);
            for (int i = 0; i < contactArray.length; i++) {
                Element conElm = document.createElement("contact");
                Text conTxt = document.createTextNode(contactArray);
    conElm.appendChild(conTxt);
    clElm.appendChild(conElm);
    }//end for
    return document;
    }// end Document
    void saveToXMLFile(Document document, File xmlFile) throws Exception {
    OutputStream os =
    new BufferedOutputStream(new FileOutputStream(xmlFile));
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer transformer = tFactory.newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");//puts information on seperate lines
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");
    transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");//gives the XML file indentation
    transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(os);
    transformer.transform(source, result);
    os.close();
    }//end saveToXMLFile
    public static void main(String[] args) {
    Sametime st = new Sametime();
    ImageIcon picIcon = new ImageIcon(st.getClass().getResource("/images/mci.gif"));//Change when default is known!
    st.setIconImage(picIcon.getImage());
    } //end main
    private void setLookAndFeel() {
    try {
    UIManager.setLookAndFeel(
    UIManager.getSystemLookAndFeelClassName());
    SwingUtilities.updateComponentTreeUI(this);
    } catch (Exception e) {
    System.err.println("Could not use Look and Feel: " + e);
    } //end catch
    } //end void setLookAndFeel
    } //end public class Sametime

    Are there features of Java 1.4 that you specifically took advantage and are there any particular lines you are having problems with or did you just freak and post it here?
    Basically compile it under Java 1.3 and see what complains. I've done several projects that compile under 1.2, 1.3, and 1.4.

  • How can I get this code to display 20 lines

    I need to get this code I have written to display 20 lines at a time, then the 20 using the Enter key.
    How would I approach this?
    I thought of making a RandomAcessFile object, but that seems like overthinking the problem, and I'm not sure that I could get that to work anyway.
    import java.io.*;
    public class ReadIt
    public static void main(String[] args)
         throws IOException
              System.out.println ("Enter The Desired .java Filename.");
              System.out.println ("Do not add the .java extention.");
              String fname;
              EasyIn type = new EasyIn();
              fname = type.readString();
              String fndotjava = new String(fname + ".java");
              //System.out.println (fndotjava);
              File inFile = new File(fndotjava);
              InputStream istream;
              OutputStream ostream;
              istream = new FileInputStream(inFile);
              ostream = System.out;
              int c;
              try
                     while((c = istream.read()) != -1)
                           ostream.write(c);
              catch(IOException e)
                     System.out.println("Error: " + e.getMessage());      
              finally
                    istream.close();
                    ostream.close();                 
    }Thanks
    Brad

    Well, a RandomAccessFile together with a counter should work. However, you can also achieve this by buffering the input rather than writing it directly out
    java.util.Vector vect = new java.util.Vector();
    try{
         while((c = istream.read()) != -1){
             vect.append(c);
    catch(IOException e){
         System.out.println("Error: " + e.getMessage());      
    finally{
         istream.close();                 
    }     with the help of
    java.util.Vector.size() and
    java.util.Vector.elementAt(int index)
    you are able to display only 20 lines at a time, you just need the additional code for reading System.in
    public static void prompt(String s){
        System.out.print(s + " ");
        System.out.flush();
      public static String readData ( BufferedReader in)  {
        boolean verfuegbar = true;
        while ( verfuegbar){
          try{
            S = in.readLine();
            if ( S != null)verfuegbar = false ;
          catch (IOException e){System.out.print (e);}
        return S;
      }now it should work with
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    prompt("return for continuing");
    int twentscount = 0;
    int count = 0;
    do{
       while( count < 20 && twentscount+count < vect.size() ){
           outstream.write(vect.elementAt(twentscount + count).toString() );
           count++;
    prompt("return");
    readData(in);
    twentscount += 20;
    count = 0;
    while(twentscount + count < vect.size());sure, this is code from head, and you can make many changes (e.g. instead of using twentscount use the modulo (%) operator saving one variable (while count % 20 != 0 ).
    I'm also not sure if it will definitly run , since i haven't tested it (especialy for index borders).
    I hope this will give you enough hints for this possible solution.
    Adrian

  • How can I export this pdf into a readable word?

    Dear all,
    I am trying to export the following pdf document into a word document :
    However, here is what I get: Db bte earf>eltung ber rf enntniff e, bie aum mernunf tgef d)de g ören, ben fid)eren @ang einer iff enfd)a gee ober nid)t, baß läßt fid) f>alb au bem @rfolg beurteilen. etc.
    Instead of: Ob die Bearbeitung der Erkenntnisse, die zum Vernunftgeschäft gehören, etc…
    Does anyone know how I could solve this issue?
    Thank you very much in advance,
    Pierre

    Have you started with a scanned document and then trying to go to DOCX. If so, you may have OCR set on the document before the export and it may be that the OCR can not recognize the fonts. However, the recognition appears to be based on typical block characters and I might interpret them the same way. You can try to change the primary language to German in the OCR, but that will likely not do the job. I suspect what you need is something that recognized old-German as this document appears to be (if I got the language wrong, I apologize). I am not sure Acrobat is up to the task on the type style, but is comparing to standard block characters. Some of the dedicated OCR packages might be able to do a better job.

Maybe you are looking for

  • How to change the text of Terms and Condition of PO.

    I have given an task to add some text to the current TERMS and CONDITIONS (T&C) of a PO. Idea is to decrease the size of fonts also as after adding the new paragraph, the T&C itself will print on 2 pages. So decrease in font size is needed to fit the

  • Preview Problem for DSC 2.0 files in CS4

    I'm having problems getting a preview for a file created in Adbobe PSCS4. The file is a Multi-channel using spot colors. The file was created new by going from a blank RGB straight to Multi-channels and spot colors assigned to each channel with an ad

  • How do I move photo's from an IPhoto album to a flash drive stick?

    I Need to know how to move photo's from a IPhoto album to a flash drive stick. Also how do I make sure the stick is formatted and blank

  • White Wireless keyboard doesn't connect on startup.

    I have a new Mini and a older Apple Wireless Keyboard, the big one. Anyway the problem is it doesn't connect to the Mini on start up. This is major problem because I can't get past the login screen without it.

  • Adopt Company Code in MIRO

    Hi all, In our system the company we have a validation to make sure the company code is populated for some postings e.g. postings to the price variance account. I have found in OSS that the system pulls the comp. code: 1. from line items 2. from the