What is this Java-code doing?

I tried to find out what this part of a JAVA code is doing.
I think that there are the two Strings 'target' and 'phrase'
declared and initialized, however, what is the value of each
of these two Strings then respectively what is the return value??
Here youe see the code:
1:....
2: private String O00OoO0O0oOoo00O00oo(String target, String phrase)
3: {
4: for(; target.length() > phrase.length(); phrase += phrase);
5: String s1 = "";
6: for(int i = 0; i < target.length(); i++)
7: s1 = s1 + "" + (char)((phrase.charAt(i) + target.charAt 8: (i)) - i);
9:
10: return s1;
11: }
thx for help!

I wrote the following program :
public static void{
1: private String abcdefghabcdefgh(String target, String phrase)
2: {  
3: for(; target.length() > phrase.length(); phrase += phrase);
4: String a = "";
5: for(int i = 0; i < target.length(); i++)
6: a = a + "" + (char)(target.charAt(i) - phrase.charAt(i) - i);
7: System.out.println(a);
8: return a;
9: }
10: String pass="xxxx";
11: String ssap="oooo";
12: String test = "";
13: test = abcdefghabcdefgh(pass, ssap);
14: System.out.println(test);
15:}
But I always got an error when I tried to compile it...
and i tried to find out for hours a de5cription for this function...
Actually I found the de5cription for String(String original) in the
API documentation, and I think this is what I wrote in line 1...
I tried so much versions so that this function would work...
but it didn't at all. (Actually I think that I importet all the java classes
I need). What the hell are I'm doing Wrong???!!!

Similar Messages

  • What is wrong in this java code?

    Can someone please tell me what is wrong in this java code?
    /* The program is intended to start animating text at the click of a button, pause it at another click and resume at the next click. It should continue like this */
    import javax.swing.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    public class TextAnime implements Runnable
    JFrame frame;
    boolean flag;
    Thread animeThread;
    JLabel label;
    String[] textArray;
    public TextAnime()
    flag = false;
    animeThread = new Thread(this);
    frame = new JFrame("Animate Text");
    GridBagLayout gbl = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();
    frame.setLayout(gbl);
    JButton button = new JButton("Start");
    label = new JLabel("Stopped");
    textArray = new String[5];
    String textArray1[] = {"Programmer", "SportsMan", "Genius", "Friend", "Knowledgable"};
    for(int ctr = 0; ctr<5 ; ctr++)
    textArray[ctr] = textArray1[ctr];
    gbc.weightx = 1;
    gbc.gridx = 0;
    gbl.setConstraints(button,gbc);
    frame.getContentPane().add(button);
    ButList bl = new ButList();
    button.addActionListener(bl);
    gbc.gridx = 1;
    gbl.setConstraints(label,gbc);
    frame.getContentPane().add(label);
    frame.setSize(200,150);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
    frame.setVisible(true);
    public class ButList implements ActionListener
    public void actionPerformed(ActionEvent evt)
    if(flag == false)
    flag = true;
    animeStart();
    else
    flag = false;
    //animeStop();
    public synchronized void animeStart()
    animeThread.start();
    Thread newThread;
    newThread = Thread.currentThread();
    newThread.notify();
    public void animeStop()
    animeThread.interrupt();
    public void run()
    int i = 0;
    try
    while(i == i)
    if(i==5)
    i=0;
    label.setText(textArray);
    animeThread.sleep(1000);
    i++;
    if (flag == false)
    animeThread.wait();
    catch(InterruptedException ie)
    label.setText("Stopped");
    public static void main(String args[])
    TextAnime ta = new TextAnime();
    Please tell me if this can be written in a more simpler manner. Also please correct this code. I am tired after trying many times.

    When I fix your error, compile and run it, I get this exception:
    Exception in thread "AWT-EventQueue-0" java.lang.IllegalMonitorStateException
         at java.lang.Object.notify(Native Method)
         at cruft.TextAnime.animeStart(TextAnime.java:81)
         at cruft.TextAnime$ButList.actionPerformed(TextAnime.java:63)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:6038)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
         at java.awt.Component.processEvent(Component.java:5803)
         at java.awt.Container.processEvent(Container.java:2058)
         at java.awt.Component.dispatchEventImpl(Component.java:4410)
         at java.awt.Container.dispatchEventImpl(Container.java:2116)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
         at java.awt.Container.dispatchEventImpl(Container.java:2102)
         at java.awt.Window.dispatchEventImpl(Window.java:2429)
         at java.awt.Component.dispatchEvent(Component.java:4240)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    %

  • When synchig my iphone to my itunes, I get an error message at the end with code 1150.  What is this error code and what does it mean?

    When synching my iphone to my itunes, I get an error message at the end with code 1150.  What is this error code and what does it mean?

    try uninstalling and reinstalling itunes on your computer. here is a link for that http://support.apple.com/kb/HT1925

  • What is the flollowing code doing?

    What is the flollowing code doing? What do the %2 %3 %4 %5 %6 %7 stand for?
    java %COH_OPTS% -Xms1g -Xmx1g -Xloggc: com.tangosol.net.DefaultCacheServer %2 %3
    %4 %5 %6 %7

    %2 would need to be the path to the "cache-config.dtd" compliant configuration file.
    %3 the interval in second to check the service status.
    The rest would be ignored.
    For Example:
    java -server -Xms512m -Xmx512m com.tangosol.net.DefaultCacheServer coherence-cache-config.xml 5
    Re: What is the flollowing code doing?
    Thanks,
    Everett Williams
    Coherence Team
    Edited by: ewilliams on Aug 26, 2009 2:36 PM

  • Android.process.acore?  What is this and why does it keep not working?

    Help: I've had my Lucid 3 phone since May and this phone has been the most confusing thing to operate.  I'm currently having three (3) issues:
    The Wi-Fi is not working...I keep getting the symbol refreshing.  I can't turn the Wi-Fi on or off.  I read "Turning Wi-Fi on..." when I go to the setting for Wi-Fi but this has been going on for 3 hours.  C'mon!  My Wi-Fi at home is working great; that's how I'm writing this post. Help!
    To add to the misery: I keep getting a pop-up notification that reads: "Unfortunately, the android.process.acore has stopped."  What is this and why does it not work. The phone's been getting this message for a week now...help!
    Last concern: I'm still not getting multimedia texts (particularly pictures).  The data and Wi-Fi were on...well, that's when the Wi-Fi was working (please refer to complaint #1 above).  What the heck?
    This phone is terrible news and I can't wait to replace it.  In the meantime, the phone needs to work. Help.
    -Salo

        We certainly want to clear up all the confusion and have a working phone in your hands, srodezno. Let's take this one issue at a time:
    1. How long ago did this trouble with WiFi start? Are you able to connect to any alternate WiFi signals other than the one at home?
    2. Do you get that notification when you access anything in particular? Did it begin when you updated or installed any application?
    3. Are you still able to access other data services (web, apps, Play Store, etc) while the WiFi is off/not working? Are you able to send the MMS messages?
    JenniferH_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • What this small code does? And how do I do it in Unicode.

    Hi.
    I got the following code and I really don't know what it does or even why. All I know It's not UC enabled ( since it's uxinf the type x).
    I was thinking I might be converting from ascii representation to text or something like that but I'm not that sure.
    FORM TRANSLATE_FIELD USING    STRING_TRAN
                         CHANGING STRING1.
      DATA: STRING(255),
             len1(3) type i,
             LEN(3)  TYPE I,
             NUM(3)  TYPE I,
             I(3)    TYPE I.
      DATA: C VALUE 'A',
            X TYPE X.
      FIELD-SYMBOLS:<fc> type c.
      STRING = STRING_TRAN.
      len1 = strlen( STRING ).
      LEN = 0.
      NUM = 0.
      while len < len1.
        i = STRING+len(3).
        move i to x.
        assign x to <fc> casting type c.
        move <fc> to c.
        MOVE C TO STRING1+NUM.
        len = len + 3.
        NUM = NUM + 1.
      endwhile.
    ENDFORM.                    " TRANSLATE_FIELD
    Thanks
    Ariel

    Hi.
    I want to make this small code UC enabled. Since there is a move of TYPE x into char this is not OK at the mopment.
    the problem is I don't really know or understand how to convert itr to UC enabled program.
    You can notice it takes clusters of 3 chars (bytes ?) long and convert them to char.
    For example 101 = e 100 = d 099 = c.... :-> 101099101 -> ece .
    Thanks
    Ariel

  • Menu Object; MANUAL option. What is this, and how does it work?

    What is this... and, how does it work? Can't find documentation on this.

    My knee-jerk reaction is, "are f'n kidding me?"... but, of course, you're not.
    I must say, that is an incredibly useless option. How would that 'option" differ from simply making a text object (or text/rectangle/image combo or group) and creating a link?
    What got me looking at this option was the hope to find some way to insert a dynamic "field" that could be used on a master page to display the current page title (of a page based on that master). Something similar to Word (and other applications) that you can enter information into a document property and then insert that information anywhere within the document by using a field code for that info. I don't know if there is an HTML code that could be used to accomplish this, in this case. Something that would refer to the page title.
    Thanks for the info none-the-less.

  • When turning pages in catalog in safari messages comes up "Are you sure you want to send a form again? it then asks if I want to cancel or resend form? what is this and why does it pop up?

    When turning pages in catalog in safari, message comes up "Are you sure  you want to send a form again? It then asks if I want to cancel or resend form? What is this and what am I doing wrong? I'm obviously new to mac.

    You can turn that off if you want ..
    From your Safari menu bar top of your screen click Safari > Preferences  then select the Security tab.
    Deselect:   Ask before sendinga a non-secure form from a secure a secure website

  • TS1702 what causes this error code - 0xe8000084

    when synching my phone, I get the above error message when itunes tries to synch several apps. What causes this and what can I do to correct it?

    There if anything on this some troubleshooting page for 0xE8 error codes helps : http://support.apple.com/kb/TS3221

  • What is this peace code mean

    public class TriangleArray {
    public static void main(String[] args) {
    int[][] triangle = new int[10][];
    for(int i=0; i<triangle.length; i++) {
    triangle[i] = new int[i+1];
    for (int i=0; i<triangle.length; i++) {
    for(int j=0; j<triangle.length; j++) {
    System.out.print(triangle[i][j]);
    System.out.println();

    When you post code, please use[code] and [/code] tags as described in Formatting tips on the message entry page. It makes it much easier to read.
    public class TriangleArray {
    public static void main(String[] args) {
    int[][] triangle = new int[10][];
    for(int i=0; i<triangle.length; i++) {
    triangle[i] = new int[i+1];
    for (int i=0; i<triangle.length; i++) {
    for(int j=0; j<triangle.length; j++) {
    System.out.print(triangle[i][j]);
    System.out.println();
    What do you think it does? And we will tell you if you are correct.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Who can help me write this Java code show the prime number ???? PLEASEEEEEE

    Write java code print prime number like this
    Sample Screen Print:
    Initial matrix with N = 37
    2 3 4 5 6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37
    Intermediate results (after 1st iteration)
    2 3 5 7 9
    11 13 15 17 19
    21 23 25 27 29
    31 33 35 37
    Intermediate results (after 2nd iteration)
    2 3 5 7
    11 13 17 19
    23 25 29
    31 35 37
    Intermediate results (after 7th iteration)
    2 3 5 7
    11 13 17 19
    23 29
    31 37
    Final results
    2 3 5 7 11 13 17 19 23 29
    31 37
    How to write this code ?
    Please Help me!
    Thank you so muchhh ?????

    h2. {color:#ff0000}Multiplepost{color}
    Replies here: http://forum.java.sun.com/thread.jspa?threadID=5241012&tstart=0
    There is a useful answer the original thread. Answer it, or ignore it as you like, but don't create multiple threads.

  • What is this error code's on x79 Gd 65 8D (99),(B2),(B4)

    Hello Msi users My names shaaban and i am from turkey years old 24 i am complete my x 79 gaming case almostly, system part list is that
    board x79 a gd 65
    mem, 16 gig gskill cl 9 2133 mhz
    cpu 3930 k
    psu  x1000 platinum
    gpu we are tryied the my friend 6990 i am havent yet now
    ssd 120 gb s 3 corsair f gt
    we are installed the components carefully everythings fine but first time we are pushing the on button system power on well but system post ed us 3 debug code b2 b4 and 99 i find the manuel book and i did see this words "console outpu/input devices/console initiaalization and load option rom (vga, Raid, parallel ports, serial ports......) Whats is this graphic card problem? if it is but we are sucsessfull installed the windows and programs and 2 hours playing battlefield 3 with radeon 6990 average 88 fps on full hd and settings ultra work fine with non anything bios update or program update pure fabrication default board but we are 2 hours end restarting the system, windows 7 normal starting but we are taking the same debug codes 99 b2 and b4...
    ThNK   YOU FOR HELPİNG AND RESPONDİNG, AND SORRY BAD ENGLİSH I MUST FİX MY SPEAKİNG...

    Quote from: Stu on 13-May-12, 23:54:27
    They are not error codes, but checkpoint codes.
    If the system passes POST and boots into Windows, then there isn't an issue. And if you're playing games for several hours without any issues, then there is no problem.
    yes bro i am experiance the minimum 1.5 hour battlefield 3 game the ultra mode fps is wawing 45 to 160 but normal 90 at 6990 strange this codes not error codes allright? okey then my system working normally??

  • IOS Firewall: what is this class map doing?

    Hi, a few weeks ago I set up a class map but now as I am finding time to review my config, I am wondering what effect this has.  It is applied to a policy map for ssh access from the Internet to the router for management:
    class-map type inspect match-any SSH
    match protocol ssh
    match access-group name SSH
    The access list with the name "SSH" just allows certain public IP network blocks. 
    But I think I should be setting this to match-all and not match-any if I want it to allow the ssh protocol from only my IP, correct? 
    Also just to ensure I am not confused about proper creation of the ACL.  The ACL with the name SSH I've given is as follows:
    ip access-list extended SSH
    permit tcp xx.xx.0.0 0.255.255.255 any eq 22
    permit tcp xx.xx.0.0 0.7.255.255 any eq 22
    permit tcp xx.xx.0.0 0.255.255.255 any eq 22
    First, am I being redundant in the class map by telling it to match protocol ssh and also specifiying port 22 in the ACL? And, is this ACL readout done properly if I want only certain IP blocks to be able to come in from the Internet, to the router, using ssh? 

    Hello Colin,
    But I think I should be setting this to match-all and not match-any if I want it to allow the ssh protocol from only my IP, correct?
    Exactly you are getting it now It needs to be a match all....
    Regarding the ACL should be like this:
    access-list SSH
    permit tcp host outside_user_ip host router_outside_interface eq 22
    Regards,

  • Nsurlsessiond - what is this and why does it use alot of data?

    Hello
    Firstly
    I was in a public library, uploading to my dropbox account, and all of sudden my network speed indicator/ montior showed heaps of download and fast too.
    but i was not downloading anything.
    I was upping to my dropbox account.
    In activity monitor i noticed this service was operating "nsurlsessiond"
    What is this service?
    In my connection alert it tells me nsurlsessiond tried to establish a connection to apple-dnld.vo.llnwd.net on TCP port 80 (http)
    Secondly, i was using my own wifi, and saw this nsurlsessiond service consuming heaps of data. Again I was upping to my dropbox account. About 1gb this time.
    Now I have blocked communciation to "nsurlsessiond"
    What is the impact of blocking such communication?
    please see details of service in screenshot
    Now after this experience, I am wondering is it apple policy to have communication from our macbook's to somwhere without us knowingly allowing it?  I thought apple was respective of our privacy, or has this changed?
    thankyou for your help and time.
    regards
    10.10.2
    dropbox v3.4.4
    macbook pro
    Message was edited by: seaseasea added screenshot
    Message was edited by: seaseasea
    added device and osx

    i couldnt say. it was just that i happen to be only upping, to dropbox, and then saw downloading on the monitor.
    that was triggered as odd.
    i rarely look at what services are going on... only if my macbook slows down or something else odd.
    in both cases i was only upping to dropbox.
    i dont do alot with my macbook, other than upping to dropbox laterly.
    thankyou for your thinking and help.

  • HT204266 What is this error code: 1009

    When i want downloading application or updating that, this error code "1009" will appear, please help me.

    See "More Like This" over there >>>>>>>>

Maybe you are looking for