Using the "this" operator to pass variable references among classes and met

Hi guys still trying to understand how to use the "this" operator
can some one tell what I am doing wrong or just make this work for me to see how it works.
public class ReferencePassing
public static void main(String[]args)
ReferencePassing rp = new ReferencePassing();
System.out.println(rp);
public ReferencePassing()
HelperObject ho = new HelperObject(this);
System.out.println(this);
class HelperObject
private ReferencePassing MyReferencePassingBuddy;
public HelperObject (ReferencePassing theRp);
MyReferencePassingBuddy = theRp;
print();
public void print()
System.out.println(MyReferencePassingBuddy);
}

Hi guys still trying to understand how to use the "this" operatorYou're still trying to understand how to write methods and constructors.
public HelperObject (ReferencePassing theRp);Syntax error at ';'.
MyReferencePassingBuddy = theRp;
print();
public void print()Syntax error: '}' expected.

Similar Messages

  • Using the "as" operator vs casting?

    I've recently been reading the docs regarding data types in
    AS3 and am still not clear on a few things. If anyone has blogged
    on this, please point me there.
    One problem is that "casting" syntax is the same as top-level
    function syntax. Compare String(objString) to XML(event.result).
    The latter is a top-level function, but the former is a "cast". Or
    is it?
    An option to the String cast is objString.toString(). What is
    the difference? I am not so much interested in the underlying
    details of the language, as in understanding when to use which.
    The same question exists for the top-level function
    XML(event.result), which can be done with the "as" operator:
    event.result as XML. When to use which? Are there performance
    issues? The "as operator" documentation is unsatisfying.
    Any discussion of this will be appreciated.
    Tracy

    ActionScript 3.0 has the
    as operator because it circumvents a deficiency with the
    cast operation () in ActionScript. Consider this:
    var a:Object = new Array(1,2,3,4);
    var b:Array = Array(a);
    What is b? It is an Array of 1 element: [ [1,2,3,4] ];
    The
    as operator takes care of this:
    var b:Array = a as Array;
    The actual difference in the operators is that if the
    variable being cast is not of the proper type, the
    as operator returns null while the () operator throws an
    exception:
    var j:Number = Number(a); // exception!
    var k:Number = a as Number; // NaN in this case, but null
    normally
    The feeling here at Adobe is to use the
    as operator since it is not ambiguous and just check for
    null. If you prefer to catch exceptions and know when X(y) is a
    cast vs a conversion, then use that. More of a preference but at
    times only
    as will do what you need.

  • How can I use the update operation in a VC Model

    Hello experts,
    i try to to use the update operation in my VC model.  I have developed an AS wich return a table. Now i want to update a table row. So I add the update operation to my model. But it doesn´t work. I mapped all attribute between the table and the update service. The event name is submit.
    Another strange thing is: If i try to update in the service browser it cames the error message that the vandatory attribute ... is missing.
    Any ideas??
    Thanks
    Marco

    Hi Marco,
    In this case it is possible that your update service requires a mandatory parameter which you are not providing.
    When you drag your service onto the VC screen, right click on the service and test it.It will give you a clear picture of which parameters are required by the service and besides you can also use some test data to check if the service is working properly.
    Do let me know if this helps.
    Thanks,
    Gaurav.

  • SSRS Expression for Conditional Filtering using the "IN" operator

    Hello,
    I need to filter my dataset based on a parameter:
    If Period= 1 then Week must be in (W1, W2, W3),  Else Week must be in (W10, W20, W30)
    I tried using the "IN" operator but don't know how to create the expression for the "Value" field. I tried the following:
    iif(Parameters!Period.Value = 1,
    "W1, W2, W3",
    "W10, W20, W30")
    But it doesn't work.
    Expression: Week
    Operator: IN
    Value: ???
    Any help would be highly appreciated!

    Hi,
    Use split function.
    See this expression: IIF(Parameters!Period.Value = 1, SPLIT("W1,W2,W3",","), SPLIT("W10,W20,W30",","))
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8da78c9b-7f0c-42f1-a9c4-82f065f317c9/using-the-in-operator-in-ssrs-expressions
    Thanks Shiven:) If Answer is Helpful, Please Vote

  • Is it possible to use the value of a string to reference a component in the

    I'm fairly new to Java so this may be a stupid question!
    Is it possible to use the value of a string to reference a component in the code? For example in the code below, Wall is a class holding 3 different arrays. The Robot class has an array called finishBricks. When the buildWall method is run it receives the integers width and height which are used to construct the dimensions string. I want to use this string to then load the appropriate Wall array into the finishBricks array.
    I hope this makes sense! Any help would be greatly appreciated!
    class Robot {
    public double[][] finishBricks;
    public void buildWall(int width, int height) {
    Wall w = new Wall();
    String dimensions = "Wall" width "x" +height;
    this.finishBricks = w.xxxx; // where xxxx is replaced by whatever the String dimensions is
    class Wall {
         public double[][] Wall4x2 = {
              {-30.00,-01.60,27.45},
              {-30.00,-06.75,27.45},
              {-30.00,-13.55,27.45},
              {-30.00,-20.35,27.45},
              {-30.00,-22.00,28.65},
              {-30.00,-16.85,28.65},
              {-30.00,-10.05,28.65},
              {-30.00,-03.25,28.65}
         public double[][] Wall3x3 = {
              {-30.00,-01.60,27.45},
              {-30.00,-06.75,27.45},
              {-30.00,-13.55,27.45},
              {-30.00,-15.20,28.65},
              {-30.00,-10.05,28.65},
              {-30.00,-03.25,28.65},
              {-30.00,-01.60,29.85},
              {-30.00,-06.75,29.85},
              {-30.00,-13.55,29.85},
         public double[][] Wall2x4 = {
              {-30.00,-01.60,27.45},
              {-30.00,-06.75,27.45},
              {-30.00,-08.40,28.65},
              {-30.00,-03.25,28.65},
              {-30.00,-01.60,29.85},
              {-30.00,-06.75,29.85},
              {-30.00,-08.40,31.05},
              {-30.00,-03.25,31.05},

    Map walls = new HashMap ();
    walls.put ("2x2", new double[][] {
        new double[] {
            1,
            0
        new double[] {
            0,
            1
    double[][] wall = (double[][]) walls.get ("2x2");

  • Select Performance problems using the 'like' operator

    I have a PL/SQL procedure that uses a cursor which contains a 'like' operator in the where clause. I have two database instances that are theoretically the same, however this code processes about 100,000 rows in 5 minutes on one database and 100,000 rows in several weeks on the other database. I know it is the 'like' operator that is causing the problem, but I don't know where to look in the database setup parameters as to what could be different between the two. Can someone point me in the right direction?

    I tried to think of another way to write the query, but I really need to use the wildcard option on the data I'm searching for. The system I'm working with attaches a suffix to the end of every ID (ie. '214-222-1234-0') The suffix ('-0') increments but the rest of the ID stays the same ('-1','-2',etc...), but I want to find all of the rows where the first 12 characters are the same, so I strip off the suffix and use a wildcard '%' in its place. I tried adding the SUBSTR() function to the left hand column of the where clause, but it was even slower than using the 'like' operator. I know its a sound query, I just can't figure out why it works fine on one database and not the other.

  • I was on facebook and deleted an icon by using the right-click menu but then all my pictures and all profile pictures, could no longer be seen. I was able to view them in Explorer so this is something I did in Firefox. How can I unblock a site?'

    '''I was on facebook and deleted an icon by using the right-click menu but then all my pictures and all profile pictures, could no longer be seen. I was able to view them in Explorer so this is something I did in Firefox. How can I unblock a site?'''

    If you select that right-click context menu entry then you block all images from that domain and not one specific image, so do not use that.
    * Check the exceptions in Tools > Options > Content: Load Images > Exceptions (e.g. sphotos.ak.fbcdn.net)
    You can use these steps to check if images are blocked:
    * Open the web page that has the images missing in a browser tab.
    * Click the website favicon ([[Site Identity Button]]) on the left end of the location bar.
    * Click the "More Information" button to open the "Page Info" window with the Security tab selected (also accessible via "Tools > Page Info").
    * Go to the <i>Media</i> tab of the "Tools > Page Info" window.
    * Select the first image link and scroll down through the list with the Down arrow key.
    * If an image in the list is grayed and there is a check-mark in the box "<i>Block Images from...</i>" then remove that mark to unblock the images from that domain.

  • I am trying to use the "This solved my question - 10 points" and the "This helped me - 5 points" but they are NOT doing anything. How do I award the points ?

    I am trying to use the "This solved my question - 10 points" an the "This helped me - 5 points" but they are NOT doing anything. How do I award the points ?

    Are you talking about the "Legend" panel at the right of the window?
    Those text are just help texts explaining the reputation points. You can only award points, if you are the original poster of a question. Then you will see active buttons to award points below the answers you receive. See here for more information: https://discussions.apple.com/static/apple/tutorial/reputation.html
    Regards
    Léonie

  • Is there a way to use the common J-K-L keystrokes to play forward and backward in iMovie '11?

    Is there a way to use the common J-K-L keystrokes to play forward and backward in iMovie '11? Most editing apps--like Final Cut Pro, QuickTime Pro, Avid, etc.--use this convention. I find not having it slows editing down considerably?  I don't see it listed in keyboard shortcuts; is there any way to add it?  Thanks!

    I don't think so. If you click iMovie/Help, you will see a list of all keyboard shortcuts.
    Here they are.
    Get information
    Open iMovie Help
    Command-Shift-Question Mark (?)
    Open the Project Properties window
    Command-J
    Open the Project Theme window
    Command-Shift-J
    Show playhead info
    Shows date, time, and keywords for video frames above the playhead.
    Command-Y
    Import and export
    Import from camera
    Command-I
    Export movie
    Command-E
    Play video
    Play video beginning from the frame beneath the pointer
    Space bar
    Play 1 second of video total—0.5 seconds before the pointer and 0.5 seconds after
    Plays only 0.5 seconds of video from the beginning of the selection or to the end of the selection if the pointer is resting within the selection border.
    Left Bracket ([)
    Play three seconds of video total—1.5 seconds before the pointer and 1.5 seconds after
    Plays only 1.5 seconds of video from the beginning of the selection or to the end of the selection if the pointer is resting within the selection border.
    Right Bracket (])
    Play selection
    Slash (/)
    Play selected event or project from the beginning
    Backslash (\)
    In the Event browser, speed up playback from 1x to 2x to 4x by pressing the key one time or two times, respectively
    Right Arrow key
    In the Event browser, slow down playback from 4x to 2x to 1x by pressing the key one time or two times, respectively
    This action works only if you’ve already sped up the playback.
    Left Arrow key
    When playing Event video, jump forward 3 seconds (6 seconds when playing at 2x speed or 12 seconds when playing at 4x speed)
    Shift-Down Arrow key
    When playing Event video, jump back 3 seconds (6 seconds when playing at 2x speed or 12 seconds when playing at 4x speed)
    Shift-Up Arrow key
    When playing Event video, jump forward to the next clip
    Down Arrow key
    When playing Event video, jump to the beginning of the current clip, or jump to the previous clip if the playhead is near the beginning of the current clip
    Up Arrow key
    Play the selected Event or project full screen
    Command-G
    Exit full-screen mode
    Escape (Esc) key
    Move the playhead by one frame
    Left Arrow key or Right Arrow key
    Freeze the playhead
    Hold down Control key
    When skimming, keep the cursor in the middle of the row
    Option-Shift
    Manage projects and events
    Create new project
    Command-N
    Move to Trash
    Moves the selected project (in the Project Library), Event (in the Event Library), or Event clip (in the Event browser) to the Trash. If only part of an Event clip is selected, the entire clip is moved to the Trash.
    Command-Delete key
    Open iMovie preferences
    Command-Comma (,)
    Page setup
    Command-Shift-P
    Print selected Event or project filmstrips
    Command-P
    Select and edit video
    Select an entire project or Event clip when a partial clip is selected, or select all project or Event clips when an entire clip is selected
    Command-A
    Select to playhead
    Expands or contracts the selection from the nearest selection border to the playhead.
    Shift-A
    Deselect all clips
    Command-Shift-A
    Add selected frames to project
    E
    Split a clip on both ends of a selection (longer than five frames), or at the playhead position if nothing is selected
    Command-Shift-S
    Cut selected frames
    Command-X
    Copy selected frames
    Command-C
    Paste selected frames
    Command-V
    Paste all adjustments
    Command-Shift-V
    Paste video adjustments
    Command-Option-I
    Paste audio adjustments
    Command-Option-A
    Paste crop adjustments
    Command-Option-R
    Paste cutaway, green-screen, or picture-in-picture adjustments
    Pastes adjustments, depending on which type of video is selected.
    Command-Option-U
    Paste video effect

  • What's the maximum size a varchar2  variable can hold for and NDS Stmnt?

    What's the maximum size a varchar2 variable can hold for and NDS Statement? I read that NDS is good for doing EXECUTE IMMEDIATE on statements that aren't too big. The 10g PL/SQL manual recommends using DBMS_SQL for statements that are too large, but it never gave a limit for what too large was. Does anyone know offhand?

    The limit is the same as the length of varchar2 variable within PL/SQL - that is varchar2(32767).It's not documented, but intermediate concatenation result can hold up to (64k-1) :
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - Production
    declare
      part1 varchar2(32767) := rpad('begin null;', 32767);
      part2 varchar2(32767) := lpad('end;',        32767);
    begin
      dbms_output.put_line(length(part1 || ' ' || /*' ' ||*/ part2));
      execute immediate part1 || ' ' || part2;
    end;
    65535
    PL/SQL procedure successfully completed.

  • To use the "Users & Groups" preferences pane, System Preferences must quit and reopen.

    When I try to access some of the system preferences in Mavericks I get an error pane that states "To use the “Users & Groups” preferences pane, System Preferences must quit and reopen."
    Has anybody had this problem and if so what is the fix?

    Usually happens if you opened one that was 32-bit. Then, you need to revert back to 64-bit.

  • I have a pc and am using the trial version for now.  I have readabout and seen  on other computers, but no matter where i look or follow the dirrections i can not find the mini bridge what am i doing wrong.  thank yo

    i have a pc and am using the trial version for now.  I have readabout and seen  on other computers, but no matter where i look or follow the dirrections i can not find the mini bridge what am i doing wrong.  thank you

    CC and CC2014 are the current versions of Photoshop.  CC stands for Creative Cloud.
    That being cleared up, a respectful request:
    Topic or subject titles should be clear, pertinent and concise so that individual users can tell at a glance if they can help or not.
    That field is not for attempting to fit your entire question in there.
    Please keep this in mind next time you post.  Thank you.

  • How to repair disc on second partition iMac 27? 10.6.8, but second is still 10.6.3.  Can I use the original 10.6.3 install disc to start, and then go to the side needing repair?

    Partitioned iMac 27, Sept. 2010.  Verify disc on HD2 says "corrupted,  needs repair," unspecified.  "Use install disc to repair."  HD2 is isolated from Internet since birth.  HD 10.6.8, but HD2 is still 10.6.3.  Can I use the original 10.6.3 install disc to start, and then go to the side needing repair, without a problem?
    Part 2:  After 4 years, suddenly when HD2 is revived from sleep, it makes an Internet connection, all settings are the same, Network shows Ethernet is unplugged, but the indicator from modem shows connection.  Maybe connected to first part of my question, but maybe not.
    Thank you.

    Graham Giles wrote:
    Have you seen this type of problem before? I think it could be a serious issue for anyone in a similar position.
    No; but then, I've not had occasion to use TDM. I've been using firerwire drives for over 10 years, both FW400 and FW800, with no issues except a bit of instability using a B&W G3 machine.
    TDM should be safe. Using cautious, manual copying of files from the Target machine to the Host machine should not result in unexpected loss of files or damage to the Target drive's directories. It should behave exactly the same as if it were an external (to the Host) firewire drive.
    •  I don't suppose there is anything I can do to 'put back' lost items from a separate Time Machine drive which has an up to date backup on it.
    There is probably a way to do that - seems to me that's one of the reasons for a Time Machine volume.
    On the other hand, if the Time Machine volume is rigidly linked to the now-absent OS on the original drive, there may be no way to effectively access the files in the TM archive.
    I know that using a cloned drive would work well in this instance.
    I have no experience with Time Machine, so perhaps someone who has will chime in with suggestions.
    With the machine in TDM with the other machine, have you tried running Disk Utility to see if you can effect repairs to the drive?

  • I'm trying to use the apple TV. I've hooked it up and found that any video downloading takes forever. A 1 minute video I shot yesterday took 20 minutes to download and watch on the Apple TV. A movie trailer took 20 minutes. Whats wrong????

    I'm trying to use the apple TV. I've hooked it up and found that any video downloading takes forever. A 1 minute video I shot yesterday took 20 minutes to download and watch on the Apple TV. A movie trailer took 20 minutes. Whats wrong????

    I am trying to figure it out, I have done everything
    I had this around the end of Jan for about a week then I did some changes in my firewall and allwas good ( or so I thought) for 2 weeks and now its back again since Friday ( thats when I noticed it)
    I have done the following
    refreshed my connection
    speedtest
    unpluged it
    check my pc firewall again and added anything to do with Apple and itunes to the exceptions list
    check my router firewall and settings myself and with my cable comp
    I also called my anti-virus/Firewall tech supp and could not find a thing
    youtube netflix work fine but streaming a 2 min 33 sec trailer from itunes takes for ever and I see the white bar downloading
    I can stream TV shows but like 20 min for it to be ready sometimes an hour
    I am also seeing downloads from itunes store for a 22 min show take 3 hours
    I have tried everything on my part. even downloaded a show from zune that was done fast as itunes used be, infact Thursday it was working fine (Itune store downloads)
    something is up with the itune store because there is nothing more I can do
    I even have a signal booster in my living room to make sure the family room and kitchen get a good signal
    my apple tv is in the next room where the modem is and router
    I also am having the same download issues on 2 computers and a ApTV2

  • Whenever i try to manually sync my iPhone with a new playlist on iTunes (on my laptop), it always gets stuck in step 7, Waiting for changes to be applied, and then nothing happens. I'm running the latest operating systems on both my iPhone 5 and macbook

    Whenever i try to manually sync my iPhone with a new playlist on iTunes (on my laptop), it always gets stuck in step 7, Waiting for changes to be applied, and then nothing happens. I'm running the latest operating systems on both my iPhone 5 and macbook

    I really don't appreciate the fact that no one from Apple seems to be dealing with the many, many threads that have started on this topic since iOS 7 came out. In any event, I seem to have solved my problem with a full software restoration -- that is, iOS software restoration.
    I clicked on "Restore iPhone..." which does a complete reinstall of the iOS but also all apps, photos, songs, etc. Took about 45 minutes, but seems to have worked.
    I had previously tried reverting to a backup of my iPhone, but that did not solve the problem. Only a full restore solved it.

Maybe you are looking for

  • How can I retrieve my iPod Touch information after I restore it?

         A couple of months ago my computer crashed and on that computer was my itunes (which contained everything that I have on my iPod Touch, over 150 purchased songs, a couple of purchased apps aswell as purchased movies, tv shows and music videos).

  • Cannot open web page in new tab in V 3.6.13

    I am using FF V. 3.6.13 with VISTA & Norton Security Suite. When I am in a web site and I click on a link, nothing happens. I have to right click on the link, chose "Open Link In New Tab" to get anything to happen. On some web sites I am unable to do

  • PPV Report

    Dear Friends, I tried but did not find any standard Purchase Price variance report. My client's report requirement is : PO, Mateial, Std Price, Std Cost , Actual Price, Actual Qty, Actual Cost, Batch, Vendor.............. All information I collected

  • How I can see the current pop-ups in the ipad?

    I want to know how I can access the popoups from the apps Thanks

  • Basic QoS questions

    Hello, Out company is finally going to install VOIP, they will be using something called Natterbox, but I've been asked to add QoS to our Cisco switches and routers in various locations I will also need to add a second VLAN for voice I believe which