Hi i just to want to know when we use object casting..

sorry about this newbie question i ve already asked to my tutor but
didn't get it...
i just wonder what will happen if we cast object..
i just can't imagin..coz im just bit slow on creative thinking...
my currently writing code is like this..
Integer nextCustID = new Integer("123456");
Customer customer = new Customer(nextCustID, "Fred");
customers.put("First", customer);
customer = (Customer) customers.get("First");
System.out.println(customer);i don't know about object casting...............................

You don't cast objects. You just cast references - widening or narrowing their "scope" along the inheritance hierarchy.
String s = new String("Hello");
Object o = (Object) s; // Explicit cast not necessary, just for clarification
String s = (String) o;While "hello" might appear as a String, then as an Object, then again as a String, it is always a String. Only the reference type to it changes.

Similar Messages

  • Hello, I just wanted to know when an update would be available for my mac mini server os x lion to resolve the issues regarding my m-audio fastrack pro usb audio interface (no midi messages recognized)

    Hello, I just wanted to know when an update would be available for my mac mini server os x lion to resolve the issues regarding my m-audio fastrack pro usb audio interface (no midi messages recognized)

    Have you reported your problems to Apple?
    BugReporter
    <http://bugreporter.apple.com>
    Free ADC (Apple Developer Connection) account needed for BugReporter.
    Anyone can get a free account at:
    <http://developer.apple.com/programs/register/>
    And/Or
    Mac OS X Feedback<http://www.apple.com/feedback/macosx.html>

  • Hi, I just want to know when will be available the new ipod touch

    Hi, I just want to know when will be available the new ipod touch

    October, as had been said here already literally dozens of times, and stated on Apple's web pages and in the Apple Store quite clearly. If you're asking for a specific date, then again as has been said here multiple times, Apple has not yet announced a specific release date.
    Regards.

  • I just want to know when can i buy my iphone 5 in china mainland......why china always been ignored...

    i just want to know when can i buy my iphone 5 in china mainland......why china always been ignored...

    Ask your government and the wireless providers what is the holdup.
    Apple is ready to sell but has not yet gotten approval.

  • I just want to know when the new ipod touch 5th generation will come out

    i just want to know when the new ipod touch 5th generation will come out

    Apple has not announced any new iPod models. When they do, we'll all find out at the same time, I would guess, since the announcement will be prominent on every Apple-related web site and will probalby be posted in multiple threads in these forums.
    Forum Tip: Since you're new here, you've probably not discovered the Search feature available on every Communities page, but next time, it might save you time (and everyone else from having to answer the same question multiple times) if you search a couple of ways for a topic, both in the relevant forums and in the Apple Knowledge Base before you post a question.
    Regards.

  • Hellow everybody ok! i dont speak english well but just i want to know what is the best resolution to connect my macbook pro to mi led 55" samsung tv

    hellow everybody ok! i dont speak english well but just i want to know what is the best resolution to connect my macbook pro to mi led 55" samsung tv

    1080i or 1080p

  • Good day actually i purchase second hand iphone from Swiss and we i try to open it in Egypt the phone showing it's locked as it was working in Swiss, so no one will help me like Apple it self just i want to know what is the way to fix this issue please?

    good day actually i purchase second hand iphone from Swiss and we i try to open it in Egypt the phone showing it's locked as it was working in Swiss, so no one will help me like Apple it self just i want to know what is the way to fix this issue please?

    You need to find out who the carrier was in Switzerland and see if they will unlock the device. The carrier with the lock is the only one that can authorize the unlock. You may need to check with the original owner and see if they can get it unlocked by the carrier if you do not qualify.

  • I want to know when I am eligible for an upgrade?

    I want to know when I am eligible for an upgrade?

        Hi RJ1950. I'm delighted that you're looking into your upgrade. It's an exciting time waiting for a new phone! Both tikibar1 and jimfitzgerald were right, you can log into My Verizon http://bit.ly/xB4iTc and see your phone's upgrade eligibility from the home screen under the usage section. Is there something I can help with while you look into your upgrade?
    Thank you
    JenniferH_VZW
    Please follow us on Twitter @vzwsupport

  • I want to know when my plan is done

    I want to know when my plan is up and I want to change my minutes

    You should be able to login to My Verizon and there is a link for contract end date.  You can also change the minutes on your plan at any time, without extending your contract.  You have the choice to backdate the change to the beginning of the current billing cycle (if you are nearing your limit), doing it today or doing it at the start of the next billing cycle.  Doing it today is often a bad idea because of the complex pro-ration rules....

  • Hello!   I am the bigest fan of APPLE!!! And i want to know when you lansate iPhone 6! My parents promised  me to buy One for me at my birthday!! Hello from romanian,Radu!    APPLE is the BEST!!!!!

    Hello!
    I am the bigest fan of APPLE!!! And i want to know when you lansate iPhone 6! My parents promised
    me to buy One for me at my birthday!! Hello from romanian,Radu!
      APPLE is the BEST!!!!!

    Sorry, no one here will have any knowledge of future iPhones.

  • Hi i want to know when ios 5 gonna be out   cos i have alot of rumor is gonna be the 10, Hi i want to know when ios 5 gonna be out   cos i have alot of rumor is gonna be the 10

    hi i want to know when ios 5 gonna be out i have alot of rumor not everybody telling the trew

    October 12 per the announcement by Apple on the October 4th Keynote. Is that true enough for you?

  • I want to know when a sql-query was excuted in DBA_HIST_SQL_PLAN !!

    Hi, all.
    I want to know when a sql query wqas excuted in past 3 month.
    select * from DBA_HIST_SQL_PLAN
    where plan_hash_value='1844343569'
    is working?
    The plan_hash_value is from v$sql_plan of current instance.
    There ware 3times database shutdown/startup.
    When a oracle instance is initiated, is the plan_hash_value of the same query changing?
    Thanks in advance.

    You can't go back 3 months unless your retention period is set to that length of time.
    select retention from DBA_HIST_WR_CONTROL;
    If you want to retain data for longer then you need to modify you snapshots settings, but this can impact your DB if it grows too large.
    BEGIN
    DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS( retention => 100800);
    END;
    Then you could get the details out by using something like
    select a.SNAP_ID, begin_interval_time, end_interval_time, SQL_ID, PLAN_HASH_VALUE,VERSION_COUNT, FETCHES_TOTAL, EXECUTIONS_DELTA , EXECUTIONS_TOTAL
    from DBA_HIST_SQLSTAT a, DBA_HIST_SNAPSHOT b
    where b.snap_id=a.snap_id
    and b.instance_number=a.instance_number
    and sql_id='&sql_id'
    ;

  • I want to know when we issue truncate table statement in oracle .

    i want to know when we issue truncate table statement in oracle .No log will be write in redo log .But we can recover data using flashback or scn.I want to know where is the actually truncate table statement log is stored in oracle database.Please explain me in detail step by step .

    Hi,
    I have truncated table after that i have restored that data.See below the example.I want to know from where it's restored.
    From which log file it's restored.
    create table mytab (n number, x varchar2(90), d date);
    alter table mytab enable row movement;
    Table altered.
    SQL> insert into mytab values (1,'Monsters of Folk',sysdate);
    1 row created.
    SQL> insert into mytab values (2,'The Frames',sysdate-1/24);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select CURRENT_SCN from v$database;
    CURRENT_SCN
    972383
    SQL> select * from mytab;
    N
    X
    D
    1
    Monsters of Folk
    30-DEC-12
    2
    The Frames
    30-DEC-12
    N
    X
    D
    SQL> set lines 10000
    SQL> /
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    SQL> select to_char(sysdate,'yyyymmdd hh24:mi:ss') from dual;
    TO_CHAR(SYSDATE,'
    20121230 09:29:24
    SQL> set timing on
    SQL> truncate table mytab;
    Table truncated.
    Elapsed: 00:00:15.75
    SQL> select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    N X D
    1 Monsters of Folk 30-DEC-12
    2 The Frames 30-DEC-12
    Elapsed: 00:00:00.28
    SQL> insert into mytab select * from mytab as of timestamp TO_TIMESTAMP('20121230 09:29:24','yyyymmdd hh24:mi:ss');
    2 rows created.
    Elapsed: 00:00:00.01
    SQL>

  • I saw in my bank account you charge me $ 2.11  just i want to know why?

    i saw in my bank account you charge me $2.11 just i want to know why?

    These are user-to-user forums, you aren't talking to Apple here and they don't monitor these forums. Is there anything in your purchase history for that amount ?
    If you don't recognise the charge then you can contact iTunes support here : http://www.apple.com/support/itunes/contact/ - click on Express Lane, then iTunes > iTunes Store

  • I have just bought a car with bluetooth and want to know how to use my iphone with it

    I bought a car with bluetooth facility and want to know how to use use iphone with it

    First, you will need to navigate to the bluetooth interface in your car. Generally, this is something built into the navigation system/entertainment system. Look for an item that says either settings or communication, or bluetooth. If you are having trouble, refer to your car's manual. Next, go to settings, general, bluetooth and change the switch to on. Follow the onscreen instructions in your car until you see something like waiting for device or this is now discoverable or something like that. Your car or some sort of weird name should now appear under the devices list in the bluetooth settings. Now, the car should give you a passcode to type into the phone (it may or may not do this). Type this in and/or follow the rest of the onscreen instructions.

Maybe you are looking for

  • Export and Import with different environments

    Gurus, Thanks for spending your time to read this thread. I have a table with say 100 rows in development area. I need only 10 rows to be moved to Quality. For example, user/pwd@D1 is the user login detail during export. user/pwd@F1 should be the log

  • Will my iMac connect wireless with my ISP modem?

    Do I need to specifically have an airport express or airport extreme base station to connect wirelessly to the internet? I have a modem that was supplied by my ISP. When I try to connect to the internet, the serial number for the modem appears, howev

  • Does switching libraries erase application data?

    So I just bought a new laptop with Windows 7, and after moving my iTunes library onto the new computer and getting it organized I plugged in my iPod touch(a second gen 8gig) and of course got the message saying that it can only be synced with one lib

  • To Activate approval procedure in general settings

    Hi all,        I am a Beginer, when i work with approval procedure, Administration->System initialization>General Settings> BP tab-> Activate approval procedure. I tried to uncheck the activate approval procedure and work it, again i coulnot able to

  • Anchor order for floats not the same as positioned frames?

    Hi, FM 8.04, Win XP. When creating two anchored frames (set to "Float" and "Top of column") in the body text, where Anchor A is a couple of lines above above Anchor B in the text, Frame B is actually displayed on the same page and Frame A on the next