About Final Object

Its possible to change the state of a final object .
What is the idea behind this .. ?
I am disturbed by this fact ..can any one tell me why?
public class FinalTest
     public static void main(String args[])
          final MyFinal a = new MyFinal();
          a.x=1;
          a.y=1;
          a.callMethod();
          a.show();
class MyFinal
     public int x = 0 ;
     public int y = 0 ;
     public void callMethod()
          x*=2;
          y*=2;
     public void show()
          System.out.println("x:= "+x+" y:= "+y);
}

Thanks for the clarifcation.
Here is the summary..
//FINAL OBJECTS STATE CAN BE MODIFIED.There's no such thing as a final object.
//ITS WRONG TO SAY "FINAL OBJECT" BUT "FINAL OBJECT
REFERENCE" IS THE RIGHT WORD.I'd say "final variable" is more correct, but at least "final reference" makes the crucial distinction between the object and the reference variable that points to it.
//THE CONCEPT OF FINAL EXISTS FOR VARIABLES NOT FOR
OBJECTS.Correct.

Similar Messages

  • Getting information about an object from JList

    Hi
    I have created a movie application and i have a JList displaying all registered movies, it uses a DefaultListModel to display these.
    I want to be able to click on an element in the JList and then push a button called "Show movie details" to display all information about the selected movie.'.
    Every new movie is added to the DefaultListModel as an object with "Titlle", "Genere" etc. If someone click on a movie, what do i do to get information about which object that was clicked. All i can see is that integers can be returned with the getSelectedIndex/Value methods. If i use one of these methods to get the object from the DefaultListModel, that would work i guess, but what when someone deletes a movie in the middle of the JList, then the indexes wouldnt match.
    Can someone help me out here? :)

    I get a big fat exception when trying to cast the returned object to a Movie object which im using.
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.S
    tring cannot be cast to Movie
    ...sure that this is the way to do it? If so, what am i doing wrong..

  • About ABAP Object

    Hello All,
    i have some question about ABAP Object.
    What is the meaning of friend class and singleton?
    Regards,
    Luke

    Hi,
    The addition Friends makes class class a friend of classes classi and or interfaces ifaci.At the sam time, all subclasses of classes classi, all classes that implement one of the interfaces ifaci and all interfaces that have one of the interfaces ifaci as a component interface become friends of class. you have to specify at least one class or interface.
    The friends of a class have unrestricted access to the protected and private components of that class, and can generate unrestricted instances of the class.
    The friends of class are not automatically friends of subclasses of class. the addition Friends does not make class a friend of its friends.
    Thea ddition global is allowed only when you use the addition public for the global class of a class pool at the same time.You can list other global classes and interfaces from the class library after global friends.This addition is generated when the Class Builder creates a global class and you specified friends at the corresponding tab page of the class Builder.
    `
    In the example , classs c2 is a friend of interface i1, and therefore also of the implementing class c1. It can instantiate these objects and access their private component a1.
    interface i1.
    endinterface.
    class c1 definition create private friends i1.
    private section.
    data a1(10) type c value 'Class 1'.
    endclass.
    class c2 definition.
    public section.
    interfaces i1.
    methods m2.
    endclass.
    class c2 implementation.
    method m2.
    data oref type ref to c1.
    create object oref.
    write oref->a1.
    endmethod.
    enclass.
    Kindly Reward Points If You Found The Reply Helpful,
    Cheers,
    Chaitanya.

  • Instantiation of static final objects

    Is there a problem with coding the following?:
    class A {
    public static final A static_final_a_obj = new A ( B.static_final_b_obj );
    private B b;
    public A ( B b ) {
    this.b = b;
    class B {
    public static final B static_final_b_obj = new B ( A.static_final_a_obj );
    private A a;
    public B ( A a ) {
    this.a = a;
    I put log messages in each of the constructors to see if it would cause an infinite loop, but it doesn't seem to. The question is 'why'.. :) How can either of the static final objects ever be fully instantiated?

    Exactly. It is not executed infinitely.
    class A {
    public static final A static_final_a_obj = new A ( B.static_final_b_obj );
    private B b;
    public A ( B b ) {
    System.out.println(" A Cons");
    this.b = b;
    public static void main(String args[]) {
         System.out.println("A");
    Output:
    B Cons
    A Cons
    A
    class B {
    public static final B static_final_b_obj = new B ( A.static_final_a_obj );
    private A a;
    public B ( A a ) {
    System.out.println(" B Cons");
    this.a = a;
    public static void main(String args[]) {
         System.out.println("B");
    Output:
    A Cons
    B Cons
    B
    Edited by: prajeshps on Sep 18, 2007 1:51 PM

  • More Details about Info Objects

    I want to enrich my technical skillset.
    So could you experts pls guide me in more detail about Info Objects in SAP BI
    Thanks,
    Vijayakumar

    HI,
    Actually the info given on thatpage is a copy paste of the information from Help.sap.com.
    [Editing InfoObjects|http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a63cde07211d2acb80000e829fbfe/frameset.htm]
    [Creating InfoObjects: Key Figures|http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a63b3e07211d2acb80000e829fbfe/frameset.htm]
    And So on
    Regards,
    Gaurav

  • Question about Final Cut Studio 3/Final Cut Pro 7

    Last year I bought Final Cut Studio 2 and got a student discount.
    I was thinking about upgrading to Final Cut Studio 3, but I saw a post that said you can't upgrade if you have the academic version. First of all, is this true, and secondly how can I tell if I have the academic version?
    If I can't upgrade, I can't afford to buy the whole package again. And surely I should have been informed of this! But can I edit a project on Final Cut Pro 6 and then work on it on Final Cut Studio 7, and back again? I presume not, but it's worth asking because I'm pretty much screwed if not and I can't get the upgrade.
    Thanks

    I want to upgrade because the macs at uni have upgraded, and I don't live near the uni I attend so it isn't practical for me to stay in their edit suites till late like everybody else does. I only bought the mac and final cut studio last year for this reason! So I prefer to edit from 2 machines: Mine, when I can, and the ones at uni when I'm collaborating with the 'crew'.
    However, I cannot see academic version written anywhere. And I know this is going to make me sound even more stupid than I already do, but I can't remember if I got the student discount on Final Cut, or whether it was just on the mac. Does anyone know where I should be looking. I've checked the 'about final cut pro' details and looked through the packaging (and my emails for the receipt) but I cannot see anything.
    Thanks

  • HT3258 what about final cut does not recognize mts file

    what about final cut does not recognize mts file

    If you have an AVCHD camcorder, you need to select one of the AVCHD Apple Intermediate Codec Easy Setups in FCE that matches how you shot the video in your camcorder.  (eg, AVCHD Apple Intermediate Codec 1920x1080i60 would be appropriate for camcorders produced for North America unless you selected some other video type in the camera's setup.)   After selecting the appropriate Easy Setup, create a new sequence then import the video from your camcorder.
    If you only have the .mts files themselves (perhaps because you copied them to your hard drive without their entire surrounding AVCHD folder structure), that's another matter.  In that case you need Clipwrap or similar app to transcode the .mts files to QuickTime/Apple Intermediate Codec before importing them into FCE.   You still need to have the correct easy setup in FCE.
    It would help to know exactly what make/model camcorder you have, and what model Mac and versions of OS X and QuickTime.

  • About Final Cut ProX: why a red line appears at the top o a file imported into a New Event? then when I restarted the Project that files comes as "Missed files" How can i fix it?

    About Final Cut ProX: why a red line appears at the top o a file imported into a New Event? then when I restarted the Project that files comes as "Missed files" How can i fix it? Thank you very much.

    Where are you importing from – a camera or computer? If you are optimizing at import, make sure the background processes are completed. (Command-9)
    Russ

  • About Order object in ATG

    Hi,
    I have some confusions about Order object in ATG. Please see -
    When actually ATG creates an Order object and how?
    Is there any scenario where we should use synchronize on Order object?
    An ItemPricingEngine invoked through a price droplet. How/when an OrderPricingEngine gets invoked?
    Thanks.

    Hi,
    Don't get confused that we need to synchronize only those things which are shared between multiple users.
    We should synchronize order because there should not be more than one thread/process updating it , else you will get inconsistencies and invalid version exceptions as already pointed by gurvinder.
    About your 3rd point :
    pricing can be invoked in many ways from many places , like droplet , formhandlers , pipelines etc.
    Enable loggingdebug on important components like OrderPricingEngine , ItemPricingEngine , Pricing tools and various Pricing calculators and study the logs  then you will be clear on what is invoked and when is invoked.

  • Today! I have a few comments about the objective error iOS 7.0

    To contact Apple was difficult, because I have a few comments about the objective error iOS 7.0 operating system.
    On iPhone 4s, iPhone 5, this operating system slowly when I touch to apple apps such as notes, compass, telephone, ... very slowly. Also as simple to use application photo of about 4 minutes, iOS 7.0 on iPhone 4s was overheat and battery from 100% use 4 minutes to 96%, so quickly. In the lock screen (not control center) when playing song, I just press forward 1 song very difficult, strong problem. On Safari, I can not adjust the font size in Reader. why have app Facetime on iPhone 4, iPhone 4s?
    Hopefully, Apple can continue to fix bugs in iOS 7 for the client and myself. On the iPad 3 and iPad 4 are also many more errors such as freezes, slow to open applications, the iOS app does not fit 7 tablet.

    To contact Apple was difficult, because I have a few comments about the objective error iOS 7.0 operating system.
    On iPhone 4s, iPhone 5, this operating system slowly when I touch to apple apps such as notes, compass, telephone, ... very slowly. Also as simple to use application photo of about 4 minutes, iOS 7.0 on iPhone 4s was overheat and battery from 100% use 4 minutes to 96%, so quickly. In the lock screen (not control center) when playing song, I just press "back" 1 song very difficult, strong problem. On Safari, I can not adjust the font size in Reader. why have app Facetime on iPhone 4, iPhone 4s?
    Hopefully, Apple can continue to fix bugs in iOS 7 for the client and myself. On the iPad 3 and iPad 4 are also many more errors such as freezes, slow to open applications, the iOS app does not fit 7 tablet.

  • Notification about cache objects changes when node dies

    Hi Guys,
         Coherence 3.3.1/389
         .Net API 3.3.1.2
         Sorry, i did not find in forum something similar to my question.
         Well, i have this situation:
         I have 8 Coherence nodes.
         I have one client connected to Coherence node number 1.
         The client have been listening for notifications about cache objects changes.
         Coherence node number 1 dead for some reason (not enough memory).
         What's happened with the client which was connected to this node?
         I think it just reconnect to other one, but what's happened with notifications which occurs until the client reconnects?
         Regards,
         Dmitry.

    Hi Dmitry,
         Notifications are delivered only while the client is connected. So if the client or its proxy fail, upon reconnection, the client will need to recover appropriately.
         If you're using Coherence's built-in client-side data management features (such as Near cache or ContinuousQueryCache), Coherence will do this for you automatically (resynchronizing the local datasets).
         One other comment, the reconnection attempt is lazy and the client will not reconnect until your application code touches a clustered resource.
         (EDIT: If store-and-forward guarantees are required, then you can queue those messages on the server on a per-client basis in a dedicated NamedCache, which the client can then consume at its leisure whenever connected. This is an application-level construct.)
         Jon Purdy
         Oracle

  • Design patterns,about value object ,how?why?could you give me a soluttion

    design patterns,about value object ,how?why?could you give me a soluttion
    use value object in ejb,thanks
    i want not set/get the value in ejb,find the method to solve it ,use value
    object ?
    how? thanks.

    Hai
    Enter your telephone number here, at the top it will say your Exchange, Phone and cabient number. If it doesn't mention cabinet that means you are directly connected to the exchange and not via PCP.
    If you are connected to a cabinet and it doesn't say FTTC is available, ask your neighbor to-do the same test (they have 2 be infinity connected). If they are, then proceed to contact the moderators here. Though it could not be showing because all the ports have been used up in the FTTC Cabinet.
    If this helped you please click the Star beside my name.
    If this answered your question please click "Mark as Accepted Solution" below.

  • 2 Questions about final cut pro 5

    My first question is quite simple, I know that previously final cut pro could only use up to 2.5GBs of memory, now I'm just a bit curious if it can use more since leopard is a 64-bit OS. Right now I'm using Final Cut Studio 1. I'm just asking this question since I intend to get an additional 4GB of ram (Right now I only have 2GB) I'm going to get Muskin's MacPro memory. I generally run my system down to about 200MB of free memory and sometimes down to 10MB when I'm using photoshop in conjunction to FCP. What does everyone think about getting an additional 4GB?
    Thanks for the answers.
    Okay, to not make two posts I'm give me final question/Problem. Ever since I've upgraded to Leapord I noticed that the playback quality in the canvas and viewer is poor. There is bad gamma. What I mean by that is that i'm getting extremes in color, I have areas that look normal followed by areas of over saturated color. It's more on the over saturated side though. Besides that the play back quality is poor, even though my sequence settings are at "Best" for video processing. I also seem to get jagged lines on things like railings, people's shoulders, and on other edges. My picture quality is grainy, however there are no artifacts. Even on the FX transistions I get the jagged lines on edges of oh say page peels and what not.
    Now when using DVD player or watching my MPEG2's on DVD Studio, they play poorly too. The image is clear however I get the horizontal lines when there is motion. Now when I put one of my DVD's in my DVD player (not computer) the problem goes away and everything looks fine. This is less of a problem (the horizontal lines), but I don't understand the poor playback quality.
    The video looks fine on my external NTSC video monitor.
    I have the GeForce 7300 graphics card, with the 24" samsung 245BW. I upgraded to 10.5 on a clean install.
    Thanks a lot everyone!!

    Thanks for my memory question!
    However I'm still getting poor looking footage. Even when I open up my source clips and play them they look poor in quality. I'm getting the horizontal lines on everything that moves and corners are not sharp, they look distorted and jagged. I never had this problem before I'm not sure whats the cause or the solution. Even the footage from Final Cut Studio's tutorial looks bad (grainy, strange contrast, jagged corners and lots of horizontal lines). However the edges on my footage look a little more jagged. I think i mentioned it already but the FX transitions that are page peels, cube spins...etc give me jagged edges too.
    I removed flip4mac and all other non-apple codecs too.
    ugh i hate computers sometimes
    -Tom

  • Problem about replicating object from R/3 to CRM!

    Dear All:
          when i replicate the customizing object from  r/3 oltp to the crm system ,in the crm system ,uesing t-code:smq1,i can see the status was 'SYSFALL' in the queue information ,the detail is 'The current application triggered a termination with a short dump',in the r/3 system,i can't find the queue.who can give me a solution,i have set all the Cross-Connectivity about r/3 and crm ,it's ok.
    My CRM system version is 5.0
    thanks !

    Check Middleware settings.
    Regards,
    Rajesh Banka

  • About lock object

    I have one TABLE with TABLE MAINTENANCE GENERATOR 
    and it has also LOCK OBJECT.
    Now I have adjusted the table by making some normal fields as primary keys
    and regenerated Table  maintenance generator ,
    It seems to me lock object also adjusted( I am able to see the newly converted primary key fields in lock object( in se11 ) ).
    Does the lock object automatically adjusts ????
    If lock object adjusts automatically --> what about the function modules ENQUEUE_ztable DEQUEUE_ztable ? these function modules also gets adjusted ?
    do I need to check the associated lock object impact ?
    How can I check ?

    Hi,
    No need to delete the Lock object. Just <b>remove</b> the Table which you modified from Lock object & <b>add again</b>. You can add the lock Parameters manually. It will be drived automatically from Table key fields.
    You no need to delete the lock object.
    Raja T
    Message was edited by:
            Raja T

Maybe you are looking for

  • Apple ID for Screen/File Sharing Home Network

    I have several Macs connected mostly by ethernet as part of my home network. I am trying to simplify the act of logging into one device from another. One method is to setup a username and password for each Mac, and then use these credentials to log i

  • Creation of Master Data InfoObject

    Hi All, I need to modify 0COMP_CODE Master data Infoobject, with adding some fields as attributes. I need to add few fields to 0COMP_ CODE, based on tables. And 0COMP_CODE should pull data from source tables while used at reporting. Can you please he

  • Can i install the cloud on both my desktop and laptop?

    can i install the cloud on both my desktop and laptop?

  • Inconsistent behaviour of PSEvent.MOVE

    I'm having trouble understanding/handling Photoshop's 'move' event. I'm trying to track a shape movement but the event is only being triggered once after another action - for example when I drag the shape around, the event is fired on the first drop,

  • Tomorrow is my last day online for the next week.

    Thanks.  Actually it's kind of made me stressful this week because there were things I wanted to do and changes I wanted to make, but I'm not going to make any substantial changes and then do a vanishing act for a week.  I just don't like doing that.