Object confusion

I'm getting a little confused over the use of objects in general in code. I always considered an object in my code basically as a pointer, such that using it in a function or adding it into a list would retain the object itself not just a copy. However this doesn't seem to be the case.
This little code snippet shows where my confusion is.
When I add a String object to the list then alter the String, shouldn't that change translate to the object in the array? Or, does ArrayList.add automatically allocate a new object to store in itself?
When I pass an Integer into the function and change the value it is not reflected in the original Integer object I passed in. This is the behavior I would expect from an int primitive. Is there a way to pass an object like this by reference rather than value?
Lastly, when I pass the ArrayList in to the function, its changes are reflected in the original list. Do ArrayLists actually represent pointers like I assumed all objects did where as Integer objects are treated differently?
public static void main(String[] args) throws Exception {
     ArrayList<String> t = new ArrayList<String>();
     String s = "a";
     t.add(s);
     s = "b";
     System.out.println(t.get(0));
     System.out.println(s);
     Integer i = 1;
     test(t, i);
     System.out.println(i);
     System.out.println(t.get(0));
public static void test(ArrayList<String> list, Integer i){
     list.set(0, "c");
     i = 2;
}

jamesss wrote:
jverd wrote:
Not in this case, because String literals are cached. If you had done s = new String("a") or s = new anything or s = anything else that creates an object, then yes.By String literals being cached you mean the literal "a" is cached right? not whatever object s is currently pointing at?s points at a String object. In that line, that object is the interned ("cached") String object containing "a".
i.e. if I rewrote it as
String s;
for(int i=0; i<5; i++){
s = Integer.toString(i);
would this actually create 5 separate objects since it is using a different string value each time?Yes.
>
and with
for(int i=0; i<5; i++){
String s = "a";
does this imply new String("a") and thus would also create 5 separate objects?No. The "a" does not create a new String object. That object is placed into the constant pool when your class is loaded, and from then on, whenever "a" appears, in your code, it's just a reference to that already existing object. If you did new String("a"), that would create a new String object, but it would be pointless to do so.
Lastly, is there any real difference between the value held by a String reference variable and an Integer reference variable, obviously they must point at their own object type but do the reference values among types basically look/act the same?No difference. Any reference variable just holds a reference that points to an object of an appropriate type, or it holds null, meaning it doesn't point to any object. What's special about Strings is how "abc" literals get put into the constant pool so that you can avoid creating new string objects in some cases. The primitive wrappers--Integer, etc.--do something similar for autoboxing with numbers in the range -128..127.

Similar Messages

  • 3.0EA1/2.1: Recent Objects "which object" confusion

    The new Recent Objects window in 2.1 could be handy, but really needs to show types where the icon isn't unique (ie package spec and package body get same icon). As the connection navigator forces you to open the spec before opening the body, you always get both in the recent objects when opening the body via the navigator.
    Also, it really needs to show the connection the object is from - if I open both the package specification and body of a package from two connections, I get four visually identical objects in the Recent Objects window.
    Not an issue in my environment, but opening two objects of the same type and name in different schemas would presumably also cause confusion.
    Can we either have additional columns for the identifying info (connection, type, schema) or can we have tool tips with that information?
    theFurryOne

    2.1 production (63.73) improved this by including "Body" after package bodies on the recent object list, but there is still no way to tell which schema or connection the objects relate to. Can we please have connection and schema included somehow in the recent object list?
    theFurryOne

  • Servlet - Multithreaded unique object confusion.

    Hye there experts.
    A Servlet is a multi-threaded unique object - no doubt about this.
    My question is straight, that I am trying to understand
    When a variable is created inside any unique multi threaded object (like Servlet),
    and when it serves number of user requests(say 10) ,
    how will it create same variable name 10 times !!!
    to be more cleare....
    If I write code like below in my doGet(...) method of sevlet,
    MyClass myobj = new MyClass()
    How the Unique servlet object will understand 10 user requests with same variable name as myobj.
    I think this applies to Java behavior of unique object that is multi-threaded, as Servlet is nothing special
    than a simple Java object at the basic level.
    Kindly clarify friends, welcome any references from specs.
    Many Thanks in advance folks !!! Have a wonderful time !

    you cracked the puzzle...nice ! thanks for addressing this query all of you guys.
    Thinking at the memory level I thought variables will be declared inside object's memory and thus, I was
    a conflict to me that how number of instances with same name is possible when many threads execute it.
    So, answer to me is like you said, instances are managed at the Thread's memory scope and not inside object's
    thus, though n threads are executing, they will have their own instance of same object, no issues with
    same name ofcourse in this case.
    so, at what level thread deals this seperate copy of its own variables ? at method scope or sevlet scope ?
    looking further into memory, where are these references and scope details are maintained ?
    any other memory area inside JVM will have this Metadata of live objects ?
    stepping ahead, if I declare this variable as volatile,
    multithreading will be serious issue with dirty reads under this case, right ?
    great job again folks, welcome comments..even if I deserve any yelling at my questions, not too much pls :-)

  • Lock Object  Confusion

    Hello All ,
                  I have create one Module Pool program.it is having three t code for creation ,change and display. it is having two table Header and details table.
    I have decided to go for shared lock as per requirement. That's why created on lock object with the help of  t code  se11 .
      My problem is how do I call that lock object in program, because all the lock object are called using called function PATTERN.  When I am also trying to do the same it give me message function not found.
    Can some one tell me :
    1 . How do I called lock object in my program.
    2.  Lock object : lock parameter are there ,Means the primery key of lock object on the logic of this the lock object is called.
    3.  would the same lock I can called for Create and change also. Would i work ?.  At the same time other operation can perform.
    Please provide me the ansower of the question.
    regards
    Swati namdeo

    Hi
    Hope it will help you.
    Pls reward if help.
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Normally ABAPers will create the Lock objects, because we know when to lock and how to lock and where to lock the Object then after completing our updations we unlock the Objects in the Tables
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    purpose: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.
    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:
    1. enque_lockobject
    1. deque_lockobject
    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    GO TO SE11
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Lock objects:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    Match Code Objects:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/41/f6b237fec48c67e10000009b38f8cf/content.htm
    http://searchsap.techtarget.com/tip/0,289483,sid21_gci553386,00.html
    See this link:
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Check these links -
    lock objects
    Lock Objects
    Lock Objects

  • OCM 10g objectives confusion

    Hi all,
    I started preparing for OCM 11g. Unfortunately the objectives aren't known yet, but I assume that they will be in the same line as those for OCM 10g.
    There are some objectives in OCM 10g for which I'm not 100 % sure what they mean.
    Does anyone know what's meant with the following objectives?
    1) "Configure the database environment to support optimal data access performance."
    -> I guess they mean follow OFA standards and placement of database files:
    index/data datafiles on separate disks, archive logs on separate disks, redo logs on your fastest disks...?
    2) "Create and manage multiple network configuration files"
    3) "Configure the network environment to allow connections to multiple databases."-> db links or anything else you could think of?
    4) "Choose the appropriate tablespace type for the intended use"
    I guess this means chose between smallfile and bigfile.
    Permanent/temporary and undo are also 'tablespace types', but this seems would seem an odd objective.
    5) "Create and manage objects to accommodate different data access methods (schema tuning)"
    I guess indexes/IOT/materialized views? Or anything else you can think of?
    Thanks,
    David

    David_S wrote:
    Hi all,
    I started preparing for OCM 11g. Unfortunately the objectives aren't known yet, but I assume that they will be in the same line as those for OCM 10g.
    There are some objectives in OCM 10g for which I'm not 100 % sure what they mean.
    Does anyone know what's meant with the following objectives?
    1) "Configure the database environment to support optimal data access performance."
    -> I guess they mean follow OFA standards and placement of database files:
    index/data datafiles on separate disks, archive logs on separate disks, redo logs on your fastest disks...?I suspect they mean "understand system performance tuning"
    >
    2) "Create and manage multiple network configuration files"More than 1 ORACLE_HOME, each with it's own TNSNAMES.ORA?
    >
    3) "Configure the network environment to allow connections to multiple databases."-> db links or anything else you could think of?Understand and manage TNSNAMES.ORA?
    >
    4) "Choose the appropriate tablespace type for the intended use"
    I guess this means chose between smallfile and bigfile.
    Permanent/temporary and undo are also 'tablespace types', but this seems would seem an odd objective.
    Yes to all.
    5) "Create and manage objects to accommodate different data access methods (schema tuning)"
    I guess indexes/IOT/materialized views? Or anything else you can think of?
    Appropriate use of all schema objects, including the 3 you mention. As well as sequences, different table types (heap/IOT/clusters), lob segment management, etc. And when/how to use temp segments. And appropriate parameters such as those affectinig block reuse.
    Thanks,
    DavidOCM is supposed to be a comprehensive "I know how to DBA in a production world" exam. I suspect anything can show up.

  • Hierarchical data transfer objects confusing Flex compiler...

    I just posted this same query on FlexCoders... but then I
    thought this might be a better target group to ask, so here goes:
    We are working on a set of data transfer objects where we
    have matching server-side java classes and client-side AS classes.
    Some of these DTO contain lists of other DTOs. As an example:
    A.java:
    public class A {
    List<B> blist
    In A.as we have...
    class A {
    public var blist : ArrayCollection;
    And we have B.java and B.as
    Then we have a RemoteObject call to pull down a bunch of A
    objects....
    Here's the problem, Flex does not compile B.as at build-time.
    So if B.as has a compiler problem, you never know about it,
    except that the 'blist' in A never gets populated. If you break
    down the data transfer and debug it. You find that during
    RemoteObject call, the blist data comes "down the wire", but as an
    ArrayCollection generic Objects, they never get turned into
    instances of Bs...
    I am guessing that this is happening because at compile time,
    there is not direct reference to B in the clientside project. Our
    covering .mxml wants one or more A objects, and inside A the blist
    is an ArrayCollection. So the compiler doesn't see a reference to
    B..
    So anyone know how we can fairly seamlessly make sure B.as
    gets compiled at build time so we'd know of compiler issues with it
    rather than spending lots of time debugging mysterious null values?
    (This appears to happen whether the project is set to compile
    on the client-side or the server-side. We are using Flex and FDS
    2.0.1 and Java 1.5)

    up...

  • Polymorphism.  Problems with my Element Objects

    As far as I know, my problem is I keep getting my Objects confused with one another. I was wondering if someone could help me please.
    Eyerything works in my abstract class and supporting classes. My application is where the issues are. It goes:
    public class PlayElementOOPS
    public static Scanner keyboard = new Scanner(System.in);
    public static void main(String[] args)
    //Data
    ElementSet anES;
    Element anE;
    String classId;
    Play2 aPlay;
    Playwright aPW;
    String possible;
    double maybe;
    boolean done = false;
    int choice;
    //Logic...
    anES = new ElementSet();
    while(!done)
    System.out.print("\nPlease enter the option you wish the program to " +
              "perform.\n\n1) Add a Play\n2) Add a "+
              "Playwright\n3) Remove a Play\n" +
              "4) Remove a Playwright\n5) Diplay all Plays\n" +
              "6) Display all Playwrights\n7) Display by a " +
              "given Playwright\n8) Display all Playwrights " +
              "by a given Nationality\n9) Quit" +
              "\n\n Choice: ");
    choice = Integer.parseInt(keyboard.nextLine());
    while(!isGoodChoice(choice)) //will output if bad choice is made
    System.out.print("\nPlease enter the option you wish the program to " +
         "perform.\n\n1) Display all Plays\n2) Display a "+
         "particular Play\n3) Display all plays by a Director\n" +
         "4) Display all Plays of a Cast member\n5) Quit" +
         "\n\n Choice: ");
    switch(choice) //switch for which choice the user makes
    case 1: addPlay(anES);
    break;
    case 2: addPlaywright(anES);
    break;
    case 3: removePlay(anES);
    break;
    case 4: removePlaywright(anES);
    break;
    case 5: displayPlays(anES);
    break;
    case 6: displayPlaywrights(anES);
    break;
    case 7: displayAPlaywright(anES);
    break;
    case 8: displayByNation(anES);
    break;
    case 9: done = true;
    break;
    public static boolean isGoodChoice(int choice)
    return(choice == 1 || choice == 2 || choice == 3 || choice == 4
              || choice == 5);
    public static void addPlay(ElementSet anES)
    int addRes;
    Play2 aPlay = new Play2();
    aPlay.readIn(); //Polymorphism
    addRes = anES.add(aPlay);
    if(addRes == 0)
    System.out.print("Could not add. Set is Full.\n");
    else if(addRes == -1)
    System.out.print("Could not add. Duplicate.\n");
    else
    System.out.print("Successful add.\n");
    public static void addPlaywright(ElementSet anES)
    int addRes;
    Playwright aPW = new Playwright();
    aPW.readIn(); //Polymorphism
    addRes = anES.add(aPW);
    if(addRes == 0)
    System.out.print("Could not add. Set is Full.\n");
    else if(addRes == -1)
    System.out.print("Could not add. Duplicate.\n");
    else
    System.out.print("Successful add.\n");
    public static void removePlay(ElementSet anES)
    String toRemove;
    boolean removed;
    System.out.print("What play do you want to remove? ");
    toRemove = keyboard.nextLine().toUpperCase();
    Play2 aPlay = new Play2();
                   aPlay = toRemove;
    removed = remove(aPlay);
    if(removed == false)
    System.out.print("Failed to remove.\n");
    else
    System.out.print("Successfully removed.\n");
    public static void removePlaywright(ElementSet anES)
    String toRemove;
    boolean removed;
    System.out.print("What play do you want to remove? ");
    toRemove = keyboard.nextLine().toUpperCase();
    Playwright aPW = new Playwright(toRemove);
    removed = remove(aPW);
    if(removed == false)
    System.out.print("Failed to remove.\n");
    else
    System.out.print("Successfully removed.\n");
    public static void displayPlays(ElementSet anES)
         String classId;
         System.out.print("Here are all of the Plays\n");
         for (int i = 0; i < anES.size(); i++)
              anE = anES.getCurrent();
              classId = anE.getClassName();
              if (classId.equals("Play2"))
                   aPlay = (Play2) anE;
                   aPlay.display();
         public static void displayPlaywrights(ElementSet anES)
         String classId;
         System.out.print("Here are all of the Playwrights\n");
         for (int i = 0; i < anES.size(); i++)
              anE = anES.getCurrent();
              classId = anE.getClassName();
              if (classId.equals("Playwright"))
                   aPW = (Playwright) anE;
                   aPW.display();
    public static void displayAPlaywright(ElementSet anES)
         Playwright aPW;
         String wTW;      
         String classId;
         System.out.print("Enter the Playwright you want to search for: \n");
         wTW = keyboard.nextLine().toUpperCase();
         for (int i = 0; i < anES.size(); i++)
         anE = anES.getCurrent();
         classId = anE.getClassName();
         Playwright aPW = (Playwright) anE;      
    if (classId.equals("Playwright"))
         if (aPW.equals(wTW))
                                  aPW = (Playwright) anE;
         aPW.display();
    public static void displayByNation(ElementSet anES)
         Playwright aPW;
         String wTW;      
         String classId;
         System.out.print("Enter the Playwright's Nationality you " +
         "want to search for: \n");
         wTW = keyboard.nextLine().toUpperCase();
         for (int i = 0; i < anES.size(); i++)
         anE = anES.getCurrent();
         classId = anE.getClassName();
         aPW = (Playwright) anE;      
         if (classId.equals("Playwright"))
              if (aPW.getNation().equals(wTW))
                                  aPW = (Playwright) anE;
              aPW.display();
    } //End Program
    I just cannot see where some of my issues are at.

    Same program, but different issue. The previous issue was fixed. This issue is in my ElementSet Class.
    I cannot see why it cannot find the symbol.
    Issue is in the public Element getCurrent() method
    Complier:
    ElementSet.java:156: cannot find symbol
    symbol : constructor Playwright(Playwright)
    location: class Playwright
                        return new Playwright((Playwright) theList[saveIndex].clone());
    The ElementSet where the issue is:
      public class ElementSet
       // Fields ...
          Element[] theList;      // Will reference an array of objects
                                  // from the subclasses of the abstract
                                                    // class, Element
          int currentIndex;       // Index of current element in the set
          int currentSize;        // Number of objects currently in the list
          final int MAXSETSIZE = 100;
                            // Maximum number of objects that can be
                                          // in an ElementSet.
       // Constructor ...
          The ElementSet constructor sets up an array with MAXSETSIZE-many
            cells to reference objects from the subclasses of Element.
            It also initializes currentIndex and currentSize.
           public ElementSet()
             theList = new Element[MAXSETSIZE];
             currentIndex = -1;
             currentSize = 0;
       // Test methods
          The isMemberOf method tests to see if the parameter, anElement,
            is already a member of the ElementSet.  Note that anElement can
            reference either a Person, a Student, or any subclass (direct
            or indirect) of the Element class.
             @param anElement the object being checked for membership in
                   the set
            @return true if anElement is already in the set and false
           public boolean isMemberOf(Element anElement)
             // Local data ...
             String paramClass = anElement.getClassName();
             String currClass;
               // Logic ...
             for (int i = 0; i < currentSize; i++)
                currClass = theList.getClassName();
         // Only compare anElement against those objects
         // that belong to anElement's class
    if (currClass.equals(paramClass))
    if (theList[i].equals(anElement))
    return true;
         // This object was not found in the set
    return false;
    The isFull method returns true if the calling object
         is full and false otherwise.
         @return true if the calling object is full to capacity and
         false otherwise.
    public boolean isFull()
    return currentSize == MAXSETSIZE;
    The isEmpty method returns true if the calling object
         is empty and false otherwise.
         @return true if the calling object is empty and false
         otherwise.
    public boolean isEmpty()
    return currentSize == 0;
    // Access methods
    The size method returns the number of objects
         currently in the set.
         @return the value of currentSize
    public int size()
    return currentSize;
    The getCurrent() method returns a reference to the
         current object in the set. Note the pre-condition.
         This method should only be called if the set is
         not empty. The method advances currentIndex to
         the next object to set up for the next call to
         getCurrent. If getCurrent returns a copy of
         the last object, currentIndex is reset to 0.
         Pre: currentIndex is not -1 (which can only
         occur if currentSize is not 0).
         @return copy of the current object
    public Element getCurrent()
    // Local data ...
    int saveIndex = currentIndex;
                   String classId;
         // Logic ...
    if (currentIndex == currentSize - 1)
    // Recycle to beginning of list
    currentIndex = 0;
    else
    // Advance currentIndex to next object
    currentIndex++;
         // Return a reference to the current object
              classId = theList[saveIndex].getClassName();
                   if(classId.equals("Play2"))
                        return new Play2((Play2) theList[saveIndex].clone());
                   else
                        return new Playwright((Playwright) theList[saveIndex].clone());
    // Mutator methods ...
    The add method adds a reference to the parameter object
         to the set if the the set is not full and if the
         parameter object is not already in the set. The
         method returns 1 if the add was successful, 0 if
         the set is full and -1 if the object is already
         in the set.
         @param anElement the object we will try to add
         @return 1 for success, 0 for no more room, and
         -1 for duplicate object
    public int add(Element anElement)
    // Logic ...
    if (currentSize == MAXSETSIZE)
    return 0; // set is full
    else if (this.isMemberOf(anElement))
    return -1; // it's already in there
    // We will add anObject to the set.
    theList[currentSize] = anElement.clone();
    // Increment currentSize.
    currentSize++;
    // Set currentIndex to object we just added if it was the
    // first object in the set.
    if (currentSize == 1) currentIndex = 0;
    // We succeeded.
    return 1;
    The clear method resets the set to the empty set.
    public void clear()
              for(int i=0; i < currentSize; i++)
                        theList[i] = null;
                   currentIndex = -1;
    currentSize = 0;
    // The display method
    The display method displays all of the objects in the
         set using polymorphism in a powerful way.
    public void display()
    if (currentSize == 0)
    System.out.println("There are no objects in the set. ");
    else
    System.out.println("Here are the objects in the set: \n");
    for (int i = 0; i < currentSize; i++)
    theList[i].display();
    System.out.println("\n");
              //The remove() method will remove a select object.
              public boolean remove(Element anElement)
                   for(int i = 0; i <currentSize; i++)
                        if(theList[i].equals(anElement));
                             for(int x = i; x < currentSize; x++)
                                  theList[x] = theList[x+1];
                             currentSize--;
                             return true;
                   return false;

  • Flash and quicktime export not possible at all!

    hi iwork dev team!
    as there was no result on my prev post, here again:
    i use keynote'08 4.02 on imac with 2gb and osx 10.5.2.
    i created a presentation with 15 slides and over all 16,5 minutes.
    each slide has a mp3 sound file attached (the speakers voice recorded externally).
    now i am facing following problems on *export to flash* (export is around 18mb):
    1) synchronization of voice and effects is different than inside keynote - i fixed this by changing times and export/test cycles, as long until i run sync in swf (please make it sync - this is terrible).
    2) starting with slide 13 some objects do not appear - in further slides many objects do not appear. the sound and time is ok, but not much to see. if i split the presentation into 2 parts, the export works fine, all objects appear in all slides, but i found no way to combine those 2 swf files....
    3) in one slide i found out that the order of appearing/disappearing objects confuses the swf export, so that many objects afterwards are not at all shown.... i played around long and splitted the slide in 2 slides and with some workarounds i got it show all objects.
    4) it would be great if at least some transitions and most effects would be supported and times of effects would be the same inside keynote and in exported swf.
    *exporting to quicktime*:
    1) first i had one large mp3 for the whole presentation and added it as soundtrack and synced it inside keynote. exporting this to quicktime made it run async. but at least export was possible for the full presentation.
    2) i splitted the mp3 for each slide and added each mp3 to each corresponding slide. this way i made it possible to export to swf (see above). but quicktime export now has no sound and slide shows up nearly endless.... qt export is impossible.
    what can i do?
    at least it would help me if i can export ONE swf file.
    best would be if it has same sync inside keynote and in swf - but i can live for now with swf export optimized sync that doesnt work inside keynote. but it should be fixed at least in the future....

    I'm currently having a similar problem, where the Flash exported by Keynote seems to randomly miss some objects on the page that appear after a click or a delay. In fact, in one case, I had embedded a EPS file in the slide, and some parts of the embedded file were exported to Flash but not others. I'm using Keynote 3.0.2, so I'm sorry to hear that Keynote '08 still has this bug which makes Flash export pretty awful to deal with.

  • When I try and view a downloaded clip in IE the screen opens but nothing happens

    When try and view a downloaded shckwave object in IE a blank screen appears
    and the little wheel goes round and round but the clip does not play

    Hi Andrew and Happy New Year to you too. Sometimes I get too busy:-)  Thanks for the information.
    Sometimes the Flash Player 10 ActiveX will install and be listed in the Add/Remove, but for some reason or the other,
    the Shockwave Flash Object, the ActiveX Control will not be installed in the browser add ons. In your case since you have version 9 installed, in addition to the above in the add ons there should be Flash9?.ocx as well. The ? mark will be a letter
    and most importantly be Enabled. This is a must for Flash Player to work.
    It is very easy to get Shockwave Flash Object confused with Shockwave ActiveX Control. The Shockwave Player that you have listed in Add/Remove also has in your add ons an ActiveX Control and they work together. The Flash Player works
    together with the Shockwave Flash Object, which is it's ActiveX Control.
    The reason I asked you about the DLM is because sometimes after in downloads it does not disconnect, so glad it's not there.
    In the Flash folder you should have listed Flash9?.ocx, FlashUtil9?.exe, install.log, Uninstall_ActiveX.exe.
    Recheck your add ons(the downloaded now and the have been used) the drop down arrow should show you both. You can tell if SFO is there as described above and if it's enabled.
    This link may be helpful to you to read over regarding Security Settings and ActiveX Controls. I wouldn't take any action at this time until we see if you need to.
    http://go.adobe.com/kb/ts_tn_19166_en-us 
    Thanks Andrew

  • EJB BMP Starter

    I have some key basic questions on BMP Entity Beans. I have been looking at the sample application at http://developers.sun.com/tools/javatools/documentation/s1s5/accountapp.html.
    1. I have a database that is pre-populated by some external ways other than EJBs. Does my BMP Entity Bean that i mapped to a specific table know about the previous data. In the sample application above, there is a loadRow method (Adding private methods to perform database calls, step 10). In it, it says:
    String selectStatement = "select balance from account where id = ? ";
    PreparedStatement prepStmt = con.prepareStatement(selectStatement);
    prepStmt.setString(1,this.id);
    Where does this.id came from? It is not set anywhere but in the ejbCreate() method. For example, if my client program just wants to list the balance from accounts table bound to an id without inserting new rows into the database, how would that happen? It confuses me since ejbCreate method is called automatically everytime i use a bean and it contains SQL insert statements.
    2. In the same example above, in section (implementing the bean's other methods, steps 3 and 4) it says:
    public void ejbActivate() {
    id = (String) context.getPrimaryKey();
    } What is this id variable? There is no type definition. Is this the id that was defined in AcccountEJB (from db mapping)? If so how do i reference to it without any class names?
    3. After all, i am looking for a clear BMP sample(with session beans using bmp beans, and servlets using session beans to access database data) that can guide me. If someone knows the place of such an example I would be very much greatful.
    I seem to be unable to grab the logic of EJB BMP. Answers to these questions would be helpful.
    Thanks in advance.

    Greetings,
    1. I have a database that is pre-populated by some external ways other than EJBs. Does my BMP
    Entity Bean that i mapped to a specific table know about the previous data. In the sampleThe container will not have any beans representing the new data until the client attempts to find them.
    String selectStatement = "select balance from account where id = ? ";
    PreparedStatement prepStmt = con.prepareStatement(selectStatement);
    prepStmt.setString(1,this.id);
    Where does this.id came from? It is not set anywhereAs shown below, it is grabbed out of the EJBObject (which gets it as a consequence of either a create or finder method call), when a bean instance is "activated" - or, 'swapped in' from the free pool and associated with the EJBObject.
    but in the ejbCreate() method. For example, if myThe ejbCreate method returns an instance of the Primary Key class which the container stores in the EJBObject. In this case, the PK class is type String and referenced by the variable 'id'.
    client program just wants to list the balance from accounts table bound to an id without inserting
    new rows into the database, how would that happen? ItPresumably, the client knows the "primary key" of the entity (the unique tuple from the accounts table which the EB represents), it wants to access and uses that as the argument to a findByPrimaryKey call against the home object.
    confuses me since ejbCreate method is called automatically everytime i use a bean and it contains
    SQL insert statements.Er, no. The bean's ejbCreate method is called by the container as a consequence of the client calling the corresponding create method on the home. It does not happen "automatically", but only as a consequence of the client wanting to create a new entity in the application - and, accordingly, in the underlying persistence resource. If the client does not want to create a new entity but, rather, use an existing one, then it calls an appropriate finder method to locate the instance and get a reference to it.
    2. In the same example above, in section (implementing the bean's other methods, steps 3 and 4)
    it says:
    public void ejbActivate() {
    id = (String) context.getPrimaryKey();
    Refer again to the above...
    What is this id variable? There is no type definition. Is this the id that was defined in AcccountEJB
    (from db mapping)? If so how do i reference to it without any class names?It is indeed the private member of AccountBean (see step 7 under "Adding a create method to the bean" of section 4).
    3. After all, i am looking for a clear BMP sample(with session beans using bmp beans, and
    servlets using session beans to access database data) that can guide me. If someone knows the
    place of such an example I would be very much greatful.It would appear that you require more grounding in the fundamentals of EJB generally - particularly with regard to their lifecycle and state transitions. Start with the specification. Then take a look at J2EE core design patterns...
    I seem to be unable to grab the logic of EJB BMP.
    Answers to these questions would be helpful.
    Thanks in advance.Regards,
    Tony "Vee Schade" Cook

  • Me and type ref

    hi all,
    i read the book written by dr horst keller and sascha kruger "abap objects" with confusion on the below script. really hope can get the help.
    1) confused 1, why creator has no create object and only create reference variable? why no need to create instance of client class?
    2) confused 2. why only me? me means everything(attribute/method) of client class? why not define as me->name just like in confused 4?
    3) why creator no create object also can creator->name?
    report self_reference.
    class client definition.
    public section.
    data name(10) type c value 'master' read-only.
    methods create_server.
    endclass.
    class server definition.
    public section.
    methods acknowledge importing creator type ref to client.  "confused 1
    private section.
    data name(10) type c value 'servant'.
    endclass.
    class client implementation.
    method create_server.
    data server_ref type ref to server.
    create object server_ref.
    call method server_ref->acknowledge exporting creator = me. "confused 2
    endmethod.
    endclass.
    class server implementation.
    method acknowledge.
    data name type string.
    name = creator->name.                   "confused 3
    write: me->name, 'created by', name.  "confused 4
    endmethod.
    endclass.
    data client_ref type ref to client.
    start-of-selection.
    create object client_ref.
    call method client_ref->create_server
    the output is "servant created by master".

    hi,
       i will explain your confusion along with your example...
    report self_reference.
    class client definition.
    public section.
    data name(10) type c value 'master' read-only.
    methods create_server.
    endclass.
    class server definition.
    public section.
    methods acknowledge importing creator type ref to client. "confused 1
    private section.
    data name(10) type c value 'servant'.
    endclass.
    class client implementation.
    method create_server.
    data server_ref type ref to server.
    create object server_ref.
    call method server_ref->acknowledge exporting creator = me. "confused 2
    endmethod.
    endclass.
    class server implementation.
    method acknowledge.
    data name type string.
    name = creator->name. "confused 3
    write: me->name, 'created by', name. "confused 4
    endmethod.
    endclass.
    data client_ref type ref to client.
    start-of-selection.
    create object client_ref.
    call method client_ref->create_server
    the output is "servant created by master".
    confusion 1:
    Normaly while creating an object we have to create a reference variable to class and then create the instance of the class with 'Create Objec' statement, but in this example we are passing a parameter creator of type client is sent to acknowledge method of server class. Here the parameter  creator is sent as an reference variable which means that the object is already created and just an reference to that variable is sent to the method acknowledge.
    confusion 2:
    here 'me' is a self reference variable of a class. It does not mean an attribute or methods of a class, it denotes the object of the class itself in which it is referenced. Normally the 'me' is used for self reference inside the class methods for refering to attributes or methods of the same class.
    eg: me->attrib1 or call method me->method1
    confusion 3:
    An ABAP class has two parts namely a defenition part and an implementaion part. The defenition part of the class contains all the attributes and declaration of the methods, whereas the implementation part contains the actual implementation of methods i.e., defenition of methods. In simple words, the defenition part of the class contains the methods name and what are the parameters like exporting, importing, changing,exceptions, etc., whereas the implementation part contains actual functionality of the method.
    As i have already stated that the parameter passed to the method are passed as reference variable, there is no need for creating object seperately and just an reference to already exisiting object is passed as parameter.
    so we can obtain the value of the attribute 'name' by means of the reference variable creator which gives the value of the client object.
    confusion 4:
    'me' is a self reference variable which is nothing but a reference to the same class, so me->name refers to the attribute name of the server class.

  • Cann't extend a inner class where as can Implement a nested Interface

    i cann't extend a inner class in some other outer class . Where as i can implement the nested Interface in some other class. Why????
    for example:-
    class ABC
    class Inner
    /* class body */
    interface TempInterface
    /* interfacebody */
    class OuterClass
    class InnerTwo extends ABC.inner //(line 1)Will give error
    class InnerTwo implements ABC.TempInterface //(line 2)Will run fine
    the line 1 is going to give compilation error i.e not in the scope but the line 2 will run fine .
    Both of the things are in the same class but giving 2 other results.
    I am not getting sufficient reasons for it.
    Can any one help me????
    Reagrds
    Arunabh

    As far as the language is concerned, the classonly
    exists in the context of an instance of theenclosing
    class.This still exhibits a class/object confusion to me.
    It should be 'instance only exists ...' or 'instance
    can only exist'. The class only exists in the
    scope of the enclosing class, but this is another
    issue.I'm not following what you're saying. The second sentence sounds like you're disagreeing with me. The last sentence sounds like you're agreeing with me.
    A non-static nested class is an instance member, just like an instance method or instance variable. As such, as far as the language is concerned, that class only exists in the context of an instance of the enlcosing class.It's not just instances of the nested class--its the class definition itself that only exists within the context of an instance of the enclosing class. That's why you have to do anEclosingIntstance.NestedClass and can't do EnclosingClass.NestedClass.

  • Object casting: confusion in ABAP Objects: Complete Reference book

    Hi,
    During Object Assignments using casting, is a Type Test carried out during the syntax check or at runtime?
    A.5.2.2 (page 1008) of 'ABAP Objects: The Complete Reference' says about Widening Cast: "...you must check at runtime...". However on the next page under A.5.3.2 it says of Widening Cast in Data References: "The syntax check precludes...".
    A.5.4 (page 1010) concerns Assignments between Object Reference Variables, but makes no mention of whether checks are carried out by a syntax check or at runtime.
    Also nowhere does it mention when Type Tests for Narrow casting takes place. Can anyone clear my confusion please? Unfortunatly I don't know enough about this stuff to test by writing some code.
    Thanks.

    William,
    Your questions can be answered by the following rule for object references, which I found in the book "ABAP Objects" by Horst Keller and Sascha Krüger:
    "... that the static type of the target variable must be equal to or more general than the dynamic type of the source variable."
    Here "static type" means the type with which an object reference variable is declared. "Dynamic type" is the type that the object reference variable has at runtime. The dynamic type of an object reference is always more special than its static type, otherwise a runtime error occurs.
    With this rule all your questions can be answered:
    1. The Narrowing Cast is always checked during the syntax check. Example:
    DATA o_ref1 TYPE REF TO object.
    DATA o_ref2 TYPE REF TO class_1.
    o_ref1 = o_ref2.  
    Here the reference o_ref2 has a dynamic type "class_1" or a subclass of it, which is narrower than its static type "class_1", which is narrower than the static type "object" of the reference o_ref1. Therefore, the syntax check says that the assignment is OK.
    2. The Widening Cast is always checked at runtime and requires an assignment using the operator ?=. If you use the operator = in the assignment, a syntax error occurs. Therefore the following  example produces a syntax error (try it yourself):
    DATA o_ref1 TYPE REF TO object.
    DATA o_ref2 TYPE REF TO class_1.
    o_ref2 = o_ref1.  
    The correction for this syntax error is:
    DATA o_ref1 TYPE REF TO object.
    DATA o_ref2 TYPE REF TO class_1.
    o_ref2 ?= o_ref1.
    Now the syntax check is satified, and the correctness of the widening cast is checked at runtime.
    Kind regards,
    Michael Kraemer
    Message was edited by: Michael Kraemer

  • Adding objects to the stage & acceessing stage properties - I'm a bit confused..

    Hi,
    I'm a little confused on two fronts regarding display
    programming:
    A. What the best way to add objects to the stage?
    B. How to access stage properties.
    I can do both of these when the project is an 'Action Script
    Project', but I'm having trouble when it is a 'Flex Project' (e.g.
    an MXML file). See the two attached files with questions included
    in the comment to see exactly what I mean.
    A. What the best way to add objects to the stage?
    =====================================
    In an action script project that extends Sprite I can just
    call addChild()
    In an MXML project I can add objects to the stage by first
    adding them to a UIComponent, then adding that to the stage.
    1. Is that the best way to do it?
    In this doc:
    http://livedocs.adobe.com/flex/3/html/help.html?content=05_Display_Programming_02.html
    it says that
    quote:
    Each SWF file has an associated ActionScript class, known as
    the main class of the SWF file. When Flash Player opens a SWF file
    in an HTML page, Flash Player calls the constructor function for
    that class and the instance that is created (which is always a type
    of display object) is added as a child of the Stage object. The
    main class of a SWF file always extends the Sprite class
    2. why cant I just add a sprite object direct to the stage
    without the UIComponent?
    3. What is the 'main class', and how can i get access to it?
    B. How to access stage properties.
    =========================
    In an action script project that extends Sprite I can just
    call trace(stage.framerate)
    But in an MXML file I cannot figure out how to access the
    stage properties.
    See the attached code for the things that I tried, but which
    didnt work.
    In the page:
    http://www.actionscript.org/forums/showthread.php3?t=140655
    It says
    quote:
    For stage access you have a couple of rules:
    * natively, only display objects have inherent access to
    stage
    * display objects only have a valid reference to stage if
    they're within the stage's display list (on the screen, after added
    to it with addChild)
    * The only display objects which immediately have access to
    the stage before the use of addChild (in their constructor) are the
    document/application class instance (root) and any instance from
    the library placed on the timeline (not created with AS).
    * Non-display object classes have to be passed or assigned a
    reference to the stage from another object which already has access
    to it - they cannot access it otherwise.
    4. How do I access the stage properties in the MXML project?
    5. I suspect this is related to the "main class", which I
    dont yet understand - is it?
    Sorry for the long post.
    cheers
    tom

    "tom saffell" <[email protected]> wrote in
    message
    news:gd7cm9$d1v$[email protected]..
    > Thanks Luigi - that helps a lot.
    > I hadnt seen the Flex 3 Developer Guide before - it's
    very useful.
    >
    > I now see that I can access properties of the
    application object directly
    > with
    > this.<property>.
    > However, the framerate property cannot be set by
    actionscript, only in
    > MXML (I
    > can set it in the <mx:application> tag). But I
    need to be able to set it
    > programatically, dependent on user input.
    >
    > 5. Is there a way around this?
    > 6. Can I set the stage's framerate to achieve the same
    outcome?
    >
    > I still dont understand why I cannot access the stage
    object. When I call
    > either
    this.stage or
    uic.stage * then I get
    quote:
    Cannot access
    > a
    > property or method of a null object reference.
    My understanding is
    > that I
    > can access the stage object via any display object on
    the display list.
    > I'm
    > confused about this bit..
    >
    > * - uic is a UIComponent that has been added to the
    display list (i think)
    > by
    > calling addChild(uic) from the AS3 within the
    application
    >
    > 7. How do I access stage properties in AS3 in an MXML
    project?
    http://www.adobe.com/livedocs/flex/3/html/help.html?content=05_Display_Programming_10.html
    It seems like possibly your real problem is that you're
    having trouble
    searching the Help effectively:
    http://flexdiary.blogspot.com/2008/07/getting-help-in-flex-builder.html

  • Confusion... Data Access Object and Collection Class

    Please help me...
    i have a Book class in the library system, so normally i would have a Collection class eg. BookCollection class which keeps an array/ arrayList of Book objects. In BookCollection class i have methods like
    "searchBook(BookID)" which would return me a Book object in the array.
    But now i'm confused with Data Access Object... In sequence diagrams there's a "Data Access class" which is used to retrieve data from and send data to a database. So, if i have the Data Access class, do i still need BookCollection class? Because BookCollection serves as a database also rite? ...

    I think you're in the right rail.
    The BookCollection class could be still usefull if you will need to manage search results with more than onne record (e.g.: search by author name).

Maybe you are looking for

  • Mail downloads emails over and over agin

    I have used Mail for years and as always worked fine but a couple of weeks ago after some updates this append! In my Mail app, i am having a problem with receiving "duplicate" emails. i will get an email, and after in downloads to Mail, the "spinning

  • Memory slots on T530

    I was wondering if both memory slots were easily accessible on the bottom of the unit. I looked at the guide but was a little unsure whether it was one or two under there. I remember years ago they were under the palm rest if not mistaken. I was hopi

  • How to Edit the message mapping in Quality server

    Hi Experts, Can you plz tell me, is there any way to edit the message mapping in QUALITY system?

  • HOW TO UNLOCK MY ITOUCH IF I FORGOT MY PASSCODE

    i just found my itouch after having it been lost for about 3 years and i do not remeber my password so i hooked it up to itunes and they say they cant open it because there is a password on it. how can i get it unlocked????

  • I think there is a bug in the new ec bios for gt60 2OD(ver1513)

    I have put a post on: https://forum-en.msi.com/index.php?topic=182144.0 The Post: I have bought a GT60 2OD-063CN. I download the new ec bios from the official site , the version is 1513(the stock version is 16f4EMS1 ver 5.04) And i follow the offical