Wrong code

Hey,
I have made the follow source:
//Opgave 1.1: Read 3 times a integer and
//double the result,output
public class Opgave1
{  public static void main(String[] args)
   {  System.out.println(
      "The follow int will be read now:\n" +
      "x=4, y=8 en z=16");
      int x, y, z;
      x = 4;
      y = 8;
      z = 16;
      System.out.println(
      "The int will be double now and\n" +
      "we put the result at the window");
      x = x * 2;
      y = y * 2;
      z = z * 2;
      System.out.println(
      "The values are: " + x, y, z);
}But what's wrong with line 19? --> "System.out.println("
Error messages is: Wrong number of arguments in method...
Who can help me?

The following code makes a more pretty output :-)
System.out.println("The values are: " +  x + ", " + y + ", " + z);Regards,

Similar Messages

  • Please! help me with this wrong code, where is mistake

    please! help me with this wrong code, where is mistake?
    import java.util.Stack;
    public class KnightsTour {
    Vars locs[];
    private int size, max=1, d=0, board[][];
    public KnightsTour(int x,int y, int newSize)
         size=newSize;
         locs=new Vars[size*size+1];
         for(int n=1;n<=size*size;n++)
              locs[n]=new Vars();
         board=new int[size+1][size+1];
         for(int n=1;n<=size;n++)
              for(int n2=1;n2<=size;n2++)
                   board[n][n2]=0;
         locs[max].x=x;
         locs[max].y=y;
         locs[max].d=1;
         board[x][y]=max;
         max++;
    class Vars{
         int x;
         int y;
         int d;
    public void GO()
         int n=0;
         while(max<=size*size)
              n++;
              d++;
              if(d>8)
                   max--;
                   board[locs[max].x][locs[max].y]=0;
                   d=locs[max].d+1;
              move();
         printBoard();
    public void move()
         int x=locs[max-1].x, y=locs[max-1].y;
         switch(d)
         case 1:x--;y-=2;break;
         case 2:x++;y-=2;break;
         case 3:x+=2;y--;break;
         case 4:x+=2;y++;break;
         case 5:x++;y+=2;break;
         case 6:x--;y+=2;break;
         case 7:x-=2;y++;break;
         case 8:x-=2;y--;break;
         //System.out.println(" X: "+x+" Y: "+y+" |"+max);
         if((x<1)||(x>size)||(y<1)||(y>size)){}
         else if(board[x][y]!=0){}
         else
              locs[max].x=x;
              locs[max].y=y;
              locs[max].d=d;
              board[x][y]=max;
              max++;
              d=0;
              //printBoard();
    public void printBoard()
         for(int n=1;n<=size;n++)
              for(int n2=1;n2<=size;n2++)
                   if(board[n2][n]<10)
                        System.out.print(board[n2][n]+" ");
                   else
                        System.out.print(board[n2][n]+" ");
              System.out.println();
         //System.out.println();
         System.out.println();
         public static void main (String[]args){
              KnightsTour k = new KnightsTour(1,1,8);
         }

    public class KnightsTour {
        Vars locs[];
        private int size,  max = 1,  d = 0,  board[][];
        public static void main (String[] args) {
            KnightsTour k = new KnightsTour (1, 1, 8);
            k.GO ();
        public KnightsTour (int x, int y, int newSize) {
            size = newSize;
            locs = new Vars[size * size + 1];
            for (int n = 1; n <= size * size; n++) {
                locs[n] = new Vars ();
            board = new int[size + 1][size + 1];
            for (int n = 1; n <= size; n++) {
                for (int n2 = 1; n2 <= size; n2++) {
                    board[n][n2] = 0;
            locs[max].x = x;
            locs[max].y = y;
            locs[max].d = 1;
            board[x][y] = max;
            max++;
        class Vars {
            int x;
            int y;
            int d;
        public void GO () {
            int n = 0;
            while (max <= size * size) {
                n++;
                d++;
                if (d > 8) {
                    max--;
                    board[locs[max].x][locs[max].y] = 0;
                    d = locs[max].d + 1;
                move ();
            printBoard ();
        public void move () {
            int x = locs[max - 1].x, y = locs[max - 1].y;
            switch (d) {
                case 1:
                    x--;
                    y -= 2;
                    break;
                case 2:
                    x++;
                    y -= 2;
                    break;
                case 3:
                    x += 2;
                    y--;
                    break;
                case 4:
                    x += 2;
                    y++;
                    break;
                case 5:
                    x++;
                    y += 2;
                    break;
                case 6:
                    x--;
                    y += 2;
                    break;
                case 7:
                    x -= 2;
                    y++;
                    break;
                case 8:
                    x -= 2;
                    y--;
                    break;
    //System.out.println(" X: "x" Y: "y" |"+max);
            if ((x < 1) || (x > size) || (y < 1) || (y > size)) {
            } else if (board[x][y] != 0) {
            } else {
                locs[max].x = x;
                locs[max].y = y;
                locs[max].d = d;
                board[x][y] = max;
                max++;
                d = 0;
    //printBoard();
        public void printBoard () {
            for (int n = 1; n <= size; n++) {
                for (int n2 = 1; n2 <= size; n2++) {
                    if (board[n2][n] < 10) {
                        System.out.print (board[n2][n] + " ");
                    } else {
                        System.out.print (board[n2][n] + " ");
                System.out.println ();
    //System.out.println();
            System.out.println ();
    }formatting ftw.
    If you call GO () you get in an infinite loop. max gets decreased, and it loops while max is smaller then or equal to size * size. Is your looping logic correct ?

  • I don't think I input a wrong code but ...

    Why I cannot unlock the ipad? I dont think I input a wrong code. And the number I type did not show on the 4 squares...I saw a lock sign in the middle of the top bar. I also do not think someone change my passwork. How can I reset the machine??
    Pls. advise. Thank you!
    mychan6121

    Force your iPad into Recovery Mode:
    1. Turn off iPad
    2. Connect USB cable to computer; leave the other end alone
    3. Press and hold the Home button down and connect the docking end of cable to iPad
    4. Continue holding the Home button until you see the "Connect To iTune" screen
    5. Release the Home button
    6. Open iTune
    7. You should see "iTunes has detected an iPad in recovery mode"
    8. Use iTune to restore iPad
    Note: You need to be patient and repeat the above many times to recover your iPad

  • Generating wrong code

    hi,
    my deployment wizard generates wrong code: all custom finder methods are
    generated wrong. i checked the xxxPSJDBC.java files and i saw that the
    wizard generates the sql-statement correct but then:
    Object __WL_typeObj = __WL_fieldSQLTypes.get("null");
    i think that this is wrong! please help!
    i am developing my beans in vaj 3.02 on nt. i found another problem which
    belongs to the same topic, i guess:
    generated code like the following is ridiculous:
    java.lang.String __WL_stmt = " select id, partno, row from item where 1=0"
    --> throws the following exception when starting Weblogic server:
    java.lang.Exception: Couldn't get ResultSetMetaData to look up field types:
    thanks for your help in advance,
    martin

    here it is.
    regards,
    martin
    "Ravi Akella" <[email protected]> wrote in message
    news:[email protected]..
    Can you post DeploymentDescriptor.txt file.
    -- Ravi Akella.
    Martin Zach wrote:
    hi,
    sorry, i did not mention that i am using wls 4.5.2 with sp1.
    martin
    Ravi Akella <[email protected]> schrieb in im Newsbeitrag:
    [email protected]..
    It depends on the WL QL(Query Language). Can you post the
    weblogic-cmp-rdbms-jar.xml?
    -- Ravi Akella.
    Martin Zach wrote:
    hi,
    my deployment wizard generates wrong code: all custom finder methods
    are
    generated wrong. i checked the xxxPSJDBC.java files and i saw thatthe
    wizard generates the sql-statement correct but then:
    Object __WL_typeObj = __WL_fieldSQLTypes.get("null");
    i think that this is wrong! please help!
    i am developing my beans in vaj 3.02 on nt. i found another problemwhich
    belongs to the same topic, i guess:
    generated code like the following is ridiculous:
    java.lang.String __WL_stmt = " select id, partno, row from item
    where
    1=0"
    --> throws the following exception when starting Weblogic server:
    java.lang.Exception: Couldn't get ResultSetMetaData to look up fieldtypes:
    thanks for your help in advance,
    martin
    [UserDescriptor.txt]

  • HT201263 Ipad mini is locked as someone has put the wrong code in too many times will not restore

    Hi
    I have a ipad mini (my step daughter does) she was given it by her father, someone has tried to put the wrong code in too many times and now is disabled is there any way I can unlock it or take of to apple?

    Hey there Bungle,
    It sounds like your iPad is disabled due too a forgotten passcode. This article should help you get it back on track:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/ht1212
    The instructions are different depending on whether or not you have synced your iPad to your computer so be sure to follow the applicable instructions.
    Thank you for using Apple Support Communities.
    All the best,
    Sterling

  • Xjc generating wrong code

    Hi,
    I'm new to the world of JAXB/xjc so please be nice even if the question is stupid.
    When running xjc on a xml schema it generates java code that imports the class it defines in the same file (see below for example output). It declares the class PropertyType and also imports it! Strange?!?
    Any hints appreciated
    -Tim
    package com.kettler.reqstd.reqdef.definition;
    import javax.xml.bind.annotation.AccessType;
    import javax.xml.bind.annotation.XmlAccessorType;
    import javax.xml.bind.annotation.XmlElement;
    import javax.xml.bind.annotation.XmlType;
    import com.kettler.reqstd.reqdef.definition.PropertyType;
    @XmlAccessorType(AccessType.FIELD)
    @XmlType(name = "PropertyType", propOrder = {
    "name",
    "displayName"
    public class PropertyType {
    -----------------------------------------------

    here it is.
    regards,
    martin
    "Ravi Akella" <[email protected]> wrote in message
    news:[email protected]..
    Can you post DeploymentDescriptor.txt file.
    -- Ravi Akella.
    Martin Zach wrote:
    hi,
    sorry, i did not mention that i am using wls 4.5.2 with sp1.
    martin
    Ravi Akella <[email protected]> schrieb in im Newsbeitrag:
    [email protected]..
    It depends on the WL QL(Query Language). Can you post the
    weblogic-cmp-rdbms-jar.xml?
    -- Ravi Akella.
    Martin Zach wrote:
    hi,
    my deployment wizard generates wrong code: all custom finder methods
    are
    generated wrong. i checked the xxxPSJDBC.java files and i saw thatthe
    wizard generates the sql-statement correct but then:
    Object __WL_typeObj = __WL_fieldSQLTypes.get("null");
    i think that this is wrong! please help!
    i am developing my beans in vaj 3.02 on nt. i found another problemwhich
    belongs to the same topic, i guess:
    generated code like the following is ridiculous:
    java.lang.String __WL_stmt = " select id, partno, row from item
    where
    1=0"
    --> throws the following exception when starting Weblogic server:
    java.lang.Exception: Couldn't get ResultSetMetaData to look up fieldtypes:
    thanks for your help in advance,
    martin
    [UserDescriptor.txt]

  • My ipad is blocked, i put wrong code?

    my pad i blocked cause i put the wrong code (pin toblock ), don't remember it. what should i do?

    Try the following:
    1. Restore:
    http://support.apple.com/kb/HT1414
    2. Recovery:
    http://support.apple.com/kb/HT1808

  • [ASK]Bugs of Java or Wrong Code?

    Dear All,
    What this is bugs of Java or me not to understand java programming, this my piece code :
    String kode = txtKode.getText();
            String nama = inputNama.getText();
            String keterangan = inputKeterangan.getText();
            try {
                Connection c = KoneksiMySql.getKoneksi();
                String sql = "UPDATE UNIT SET NAMA=?, KETERANGAN=?, WKT_INPUT=now() WHERE KODE=?";
                PreparedStatement p = c.prepareStatement(sql);
                p.setString(1, nama);
                p.setString(2, keterangan);
                p.setString(3, kode);
                p.executeUpdate();
                p.close();
                JOptionPane.showMessageDialog(null, "Data Berubah",
                        "Pemberitahuan", JOptionPane.INFORMATION_MESSAGE);
            } catch(SQLException e) {
                System.out.println("Error : " + e);
                JOptionPane.showMessageDialog(null, "Proses Rubah Unit Gagal",
                        "Pesan Error", JOptionPane.ERROR_MESSAGE);      
            }finally {
            inputNama.setText(null);
            inputKeterangan.setText(null);
                btnTambah.setEnable(true);
                btnHapus.setEnabled(false);
                btnRubah.setEnabled(false);
                inputNama.requestFocus();
    JOptionPane is Show and no error appears but data in database does not change, and code in block finally not executed.
    i'm use jInternalFrame, first run Only 'Add Button, Search Button' enable and other button are disable, then when 'Search Button' is clicked and open other jInternalFrame and get data form database, 'Add button' Disable and 'Delete Button, Change Button' are Enable. that my piece code on Change Button ActionPerformed.
    Please it's support.
    Thanks,
    Best & Regrads.

    Cross posted
    [ASK]Bugs of Java or Wrong Code?
    [HELP]Bugs of Java or Wrong Code?
    db

  • IPhone is disabled put wrong code - try again in 23,109,372 minutes

    Hi,
    I'm using iPhone 4S since a long time, but yesterdy my kid put wrong code many times and my handset is disabled and its showing on screen that try again in 23,109,388 minutes. Kindly guide my how to restore /activate my hand set.Thank you.
    Best regards,
    Mobin

    Hey MuhammadMobin,
    Thanks for the question. I understand you are experiencing a disabled alert on your iPhone. The following article outlines the potential resolution for this issue:
    iOS: Forgotten passcode or device disabled after entering wrong passcode
    http://support.apple.com/kb/HT1212
    Thanks,
    Matt M.

  • My ipad had passcode.wrong code was fed. the ipad is disabled now. what to do?

    my ipad had passcode.wrong code was fed. the ipad is disabled now. what to do?

    If the iPad is showing the red disabled screen due to too many incorrect passcode attempts then you will need to connect it to the computer that you normally sync to and you should then be able to reset the iPad and re-sync your content to it (http://support.apple.com/kb/HT1212) - you may need to put the iPad into recovery mode : http://support.apple.com/kb/ht1808
    If you do it via a different computer then :
    If you restore on a different computer that was never synced with the device, you will be able to unlock the device for use and remove the passcode, but your data will not be present.

  • HT4993 attempted the wrong code to many times now oys saying log into itunes

    Attempted wrong code to many times now its satingblog into itunes

    The following has instructions: http://support.apple.com/kb/ht1212

  • I pressede the wrong code for the password several times

    how long will I have to wait before I can open the phone

    That means you've typed in the wrong code too many times and the phone is now disabled.
    You need to restore the device from backup on the last computer it was synced with when the passcode was turned on... this will remove the passcode.
    If you do not have access to the last computer it was synced with, or you don't have a backup, you will have to force it into recovery mode & restore as a new device.  At this point, you will lose all data on the phone.
    See this for more info... http://support.apple.com/kb/HT1212

  • Lyrics display wrong code

    When I use the software 'Tag&Rename3.2" or iTunes to edit lyrics(use ANSI or Unicode Code),the lyrics can display correctly in iTunes,but on the nano it display wrong code.I think the reason maybe the lyrics code is ansi code,but when I change it into unicode to paste into iTunes,and it can't display correcly on nano either.How can I do?
    iPod nano 4GB Black   Windows XP Pro   OS and iTunes 6 are Simflied Chinese(PRC)
      Windows XP Pro  

    this is an easy way for lyrics,
    first, find the lyrics on google.
    second copy and paste them into the lyics tab
    third click done.
    you dont really need a program for it and its much easier this way,
    Nano 4GB black,Moto RAZR V3 black, PSP, all kinds of cases for nano,radio/remote   Windows XP   <img src="http://i36.photobucket.com/albums/e13/superman5656/s.gif"align="right"</span>

  • [6120c]Startup: wrong code was entered 5 times, i'...

    Hello all,
    I've put my phone in a pocket on my handbag, phone was locked via security code.
    Due to occasional pushes on a keyboard, as far as I can gather, there were dials of random digits to input field of security code.
    After I took my phone and tried to unlock it, after dial I get message like "wrong code was dialed 5 times, dial it 5 minutes after" (I have non-english language on a phone).
    I tried to unlock it after 5 minutes, 15, one hour and more, but I still get that message.
    Rebooting gave nothing (i've reloaded a battery).
    Looks like something is going wrong. What can I do?
    I don't want to do anything which will reset phone's memory.
    Thanks.
    Solved!
    Go to Solution.

    Contact your service provider and see if they can help..
    --------------------------------------------------​--------------------------------------------------​--------------------------------------------------​--If you find this helpful, pl. hit the White Star in Green Box...

  • Put wrong code in to ipad to open now its locked

    my wife has put in the wrong code to open the ipad now she can not open it and it has locked her out

    Try the following:
    1. Restore:
    http://support.apple.com/kb/HT1414
    2. Recovery:
    http://support.apple.com/kb/HT1808

  • Chinese Input hangs when typing wrong codes

    So I use chiense Cangjie input sometimes, I realize the input hangs when I type in the wrong code, then it keeps enter the code that I typed in individually

    You can report this to Apple here:
    http://www.apple.com/feedback/macosx.html

Maybe you are looking for

  • Iphone 5 imessage still on after deactivation?

    so i recently sent in my phone to get fixed.. not to an apple retailer but to a repair shop. everything was fine up until last night. i had activated my old android device while my iphone gets fixed. i was having a conversation with a friend who also

  • Sharing music from laptop to Imac duplicates in library

    Everytime my daughter or wife download music to laptop then I update library on Imac it duplicates the whole library again. I just got rid of exact duplicates on Imac, so now my question is how do I transfer between the two with out transfering the w

  • Compilation errors on CommandLine works ok in JDeveloper!

    Hi, I am trying to run the application on a commandline. I am able to run it fine in JDeveloper as the application is created in JDeveloper. But I need to run it on a commandline. I need some help how to make it work. Here is the scenario: I have two

  • VPN stops working after 60 seconds.

    Hello Everyone I am having problem with my vpn i am using Express vpn on windows 8.1 64 bit last week everything was working fine. Now i am being disconnected every 60 seconds then i have to reconnect it and again it works for 60 seconds.  I am using

  • Why does my iPhone close apps before they've loaded?

    Whenever I open apps on my iPhone 3GS, the phone closes out of the app before it even opens. It does this with all of my apps, such as Messages, Safari, and any game or other app I try to open on my iPhone.