Difference Between Base b = new Base(); AND  Base b = new Derived(); ???

I want to clarify the following, please help!!!
class A
{ public void f()
{ System.out.println("A->f");
class B extends A
{ public void g()
{ System.out.println("B->g");
public class Test
{ public static void main(String[] args)
{ A a = new A();
     A a = new B();
a.f();
//a.g();
A a = new A(); //(1)
means create an instance of class A of type A. Correct??
A b = new B(); //(2)
means create an instance of class B of type A
In both (1) and (2), instance "a" can access any methods of class A, but
cannot access any methods of class B
What's the difference then???

I want to clarify the following, please help!!!
class A
{ public void f()
{ System.out.println("A->f");
class B extends A
{ public void g()
{ System.out.println("B->g");
public class Test
{ public static void main(String[] args)
{ A a = new A();
     A a = new B();
a.f();
//a.g();
A a = new A(); //(1)
means create an instance of class A of type A.
Correct??Not quite. It means "define a variable 'a' of type 'class A', create an instance of 'class A' and assign the reference to that instance to variable 'a'.
A b = new B(); //(2)
means create an instance of class B of type ANot quite. It means "define a variable 'b' of type 'class A', create an instance of 'class B' and assign the reference to that instance to variable 'b'.
In both (1) and (2), instance "a" can access any
methods of class A, but
cannot access any methods of class BWell, the object actually referenced by the variable of type 'class A' is really an instance of class B and so if class B implemented a different behavior for any method defined in class A, then calling that method through a variable of class A would still get the behavior of class B - i.e. you get polymorphism.
Chuck

Similar Messages

  • Difference between Base Hierachy and Alternate Hierachy

    Hi da,
    Can you please tell me what is the difference between base hierachy and alternate hierachy ?
    and is there some other types of hierachies ?
    Thanks and Regards,
    Sri.

    Let's say you have a Time dimension and it has a Hierarchy called "Total Year".
    It might look like the following:
    Total Year
    --Q1 +
    ----Jan +
    ----Feb +
    ----Mar +
    --Q2 +
    ----Apr +
    ----May +
    ----Jun +
    --Q3 +
    ----Jul +
    ----Aug +
    ----Sep +
    --Q4 +
    ----Oct +
    ----Nov +
    ----Dec +
    'Total Year' is your base hierarchy.
    Now suppose you work for a CFO who is very superstitious and believes all months that begin with the letter 'J' are bad luck because he had a traumatic experience when he was a kid in the month of July. Anyway, he wants to track activity for months that begin with 'J' and asks you to create an alternate hierarchy.
    It would like this
    'Bad Luck Months'
    --Jan + (Shared Member)
    --Jun + (Shared Member)
    --Jul + (Shared Member)
    So your alternate hierarchy consists of "Shared Members" from your base hierarchy. It allows you to group the members in a different ("alternate") way.
    HTH

  • Difference between "base quantity" and "operation quantity" in an operation

    Hello
    what is the difference between "base quantity" and "operation quantity" in a production order ?
    thank you for your answers

    Base Quantity - Quantity of the material to be produced to which the standard values of the operation refer.
    Operation Quantity - Quantity planned for this operation.
    Base quantity and operation quantity may not always be the same, if we have partial lots delivered during the sequence of operations, the operation quantity will be equal to the lot delivered during the operation.
    Base quantity is dependent on the BOM, where it signifies the total quantity of output after using the components of certain quantity.
    Hope this may help you.

  • What is the difference between base method 0002 and 0011

    Hi,
    could you please explain what is the difference between base method 0002 and 0011?
    0002: Ordinary: no automatic depreciation
    0011: Ordinary: percentage from useful life
    if we assing base method: 0002 in dep. key? what will happen in future?
    if we assing base method: 0011 in dep. key? what will happen in future?
    please clarify my doubt.?
    Thanks
    Indu

    Let me clear, I have bought WinSL 8.1 SNGL OLP NL Acdmc Legalization GetGenuine (part
    No - 4HR-00400). It means my machine has legal OS and I can use it and I dont need to buy WinPro
    8.1 SNGL Upgrd OLP NL Acdmc (Part no. - FQC-08173).
    is it?
    I believe that is correct. There should be no reason to buy both licenses for one machine. You should verify this with your reseller or MS.
    Don
    (Please take a moment to "Vote as Helpful" and/or "Mark as Answer", where applicable.
    This helps the community, keeps the forums tidy, and recognises useful contributions. Thanks!)

  • Difference between base methods

    What is the difference between base methods 07: Percentage from life (after end of life) and 011 ( % from useful life).
    Thank you in advance.

    Hi
    011 (% from useful life) - Here we derive the depreciation from the total useful life of the Asset. The rate of depreciation remains same for each year.
    07 - In this case the system calculates the depreciation even after the Useful life of the Asset. We depreciate an Asset until the Net Book value is reached Zero. If the Net Book value of the Asset doesn't reach zero then we can depreciate the Asset beyond the Planned Useful life.  We use this in such circumstances.
    Regards,
    Giridhar
    Assign points if useful.

  • What's the difference between old SAP appraisal system and the new SAP appraisal system?

    Hi Experts,
    What's the difference between old SAP appraisal system and the new SAP appraisal system?
    Can anyone shed some light please.
    Thanks.

    emgr_update no longer sets or gets the thesaurus from workbench. In 11 all workbench configurations are saved in IFCR configuration directly.
    Hence the thesaurus entry should be added directly in version 11 Workbench as opposed to xml file in older versions.
    And if you want to migrate the changes across environments then import_site script in control directory can be used.

  • Difference between the TABs  "All Content" and "Discussions" on the new forum?

    Hi,
    Does anyone know the difference between the TABs  "All Content" and "Discussions" on the new forum?  They seem to be the same.  I'm confused.
    Petey

    Petey,
    Though I was part of the forum update beta, there was some that we could not effectively test, plus some aspects (like "Like"), that some liked, but others did not. That sort of thing happens.
    Also, now that we have the full version, and all servers are synced, there will probably be things that the beta testers did not get to experience. We will all be learning, in the process too. Also remember, much of the new forum software was provided by Jive, and though many of us commented (pros and cons), only so much could be addressed. It was not quite like doing a beta on Adobe software, as there was a complete, separate layer in between.
    So far, what I see looks close to what we saw a few weeks (months?) ago. Now, I need to really put the real software through its paces, to see what got changed from then, until now.
    Good luck,
    Hunt

  • What is the difference between 11.1.0.1 And  11.1.0.1.1

    What is the difference between 11.1.0.1 And 11.1.0.1.1

    11.1.0.1 is the base version of Oracle installed on the system.
    11.1.0.1.1 is the version of PSU (patch set update) applied to the base release version.
    Take a look at this http://docs.oracle.com/cd/B28359_01/server.111/b28310/dba004.htm

  • What is the difference between version 4.7 EE and ECC 6.0 in SD module.

    Hi SAP Gurus,
    what are the features in 4.7 EE version in general.
    what are the features in ECC 6.0  version in general.
    then give me the exact difference between version 4.7 EE and ECC 6.0 in SD module.
    if u give the information, then u will get the rewards.
    Regards,
    somu.

    Hi Somu,
             These are additional enhancements avialble in ECC6.0 other than that remaining same as 4.7E
    1.E-Commerce:- SAP ERP provides powerful e-commerce capabilities that can be expanded in an easy, cost-effective manner in line with business growth. Organizations can run a complete sales process on the Internet, and provide business-to-business (B2B) and business-to-consumer (B2C) customers with personalized and interactive online self-services.
    2.Mobile Sales for Handhelds:-SAP ERP enables sales professionals to access front- and back-office business processes and to manage critical sales activities in the field using standard PDAs or other handheld devices (including those with bar code scanners). In this area, SAP ERP provides the following functions:- Customer managementWith SAP ERP, sales professionals may enter, view, and modify detailed customer information, and view sales order history for each customer.- Sales order managementSAP ERP enables sales staff to take sales orders via bar code scanners; search, create, and modify sales orders; and list or sort sales order partners.- Material managementSupport for material management for mobile sales enables staff to view material lists or details for a specific material, search material, and display customer-specific prices.
    3.Resource-Related Down Payments and Billing:-- Supports creation of down-payment requests analogous to the functions offered by resource-related billing- Enables organizations to bill the requesting company code for services provided via a resource-related billing document.
    4.SAP Beverage Functions Available for the Consumer Products Industry:- As of SAP ERP Central Component (SAP ECC) 5.00, the following functions from the SAP beverage industry solution are available for the consumer products industry:* SAP ECC 5.00, consumer products (EA-CP 500)- Material sorting- Extra charge- Empties management- Part load lift orders- Pendulum list indirect sales- Sales returns- Excise duty* SAP ECC 5.00, supply chain management extension (EA-SCM 500)- Direct store delivery back-end- Master data- Visit control- Transportation planning (including loading units, aggregation categories)- Vehicle space optimization- Output control (including valuated delivery note)- Route accounting (including tour data entry, cash payer, route settlement)* SAP ECC 5.00, industry-specific sales enhancements (EA-ISSE 500)- Extended rebate processing.
    5.Credit Management:-Integrating sales and distribution (SD) credit management with SAP Credit Management application:With SAP ERP 6.0 application, you can also use SAP Credit Management in SAP Financial Supply Chain Management set of applications (FIN-FSCM-CR) to perform all credit checks and commitment updates for all areas of sales (SD-BF-CM). In SAP Credit Management, you can update the data from multiple systems. This enables you to execute credit checks with consistent data in distributed systems, too. Furthermore, you can connect to external credit information providers by extensible markup language (XML) interfaces. Alternatively, you can continue to use SD Credit Management (SD-BF-CM).
    6.E-Commerce: Catalog Management :-As of SAP ERP 6.0 application, you must carry out product catalog replication from your ERP solution to the Text Retrieval and Information Extraction (TREX) server for use in the Web shop, using the report ISA_CATALOG_REPLICATION.
    7.E-Commerce: Quotation and Order Management:- Order creation with reference to a contract that has been displayed* Lock of sales documents to avoid concurrent access during the order change process* Display of bills of material in the shopping basket* Free goods processing* Processing of grid products for the SAP Apparel and Footwear application* One-step business order processing* Selection of multiple transaction types in the shopping basket* Credit card support in business-to-business (B2B) Web shop* Material number format conversion* Maintenance of delivery priority in the shopping basket (B2B)* Document search for all documents across all sales areas* Interprocess communication-characteristic value display in basket and order confirmation
    8.E-Commerce: Selling Over eBay:-Creation and management of product listings on eBay leverages the e-commerce order management and fulfillment capabilities of the SAP ERP application by easily tying existing tax, pricing, shipping, and payment configurations to post-auction processing. Enhancements in 2005: * You can use the business-to-consumer (B2C) checkout instead of the eBay checkout. With the B2C checkout, you can maximize cross-selling and up-selling opportunities by leveraging B2C functionality, determine tax and shipping using the elaborate methodologies available through condition techniques in SAP ERP 6.0. * E-mail notification scenario: winner notification to keep the auction winner updated with the status of the auction and of his or her order * Monitoring through features such as single-activity trace (SAT), heartbeat, and logging * Creation and publishing of multiple-item auctions and manual retraction of winners
    9.E-Commerce: User Management:-- Web-based user management for business-to-business internet users - Assignment of authorization roles to users in web-based user management - Automatic migration of SU05 to SU01 internet users
    10.Enterprise Services in Sales Order Management:-Please check in the Enterprise Services Workplace site which enterprise services are available for sales order management on the SAP Developer Network site (www.sdn.sap.com).
    11.Internet Pricing and Configurator (IPC):-The IPC is enhanced and integrated to allow configuration within the sales documents of the SAP ERP application reusing existing model data while leveraging its improved functionality and advanced user interface within SAP ERP.
    12.Price Catalog (PRICAT): – Inbound Processing (Retail):-Inbound message processing of PRICAT essages:As of SAP ERP Central Component enterprise extension retail 6.0 (EA-RET 600) component, you can create and change article data automatically, or in an interface for mass data handling. The system takes both single and generic articles and bills of material and prices into account.
    13.Rebate Condition Records Using Scales:-As of SAP ERP 6.0 application, you can set up rebate agreements so that the scale base value and the rebate scale level is derived from the total sales volume of multiple condition records. You do this by grouping condition records in the rebate agreement.
    14.SAP Role: – Internal Sales Representative:-SAP role – internal sales representativeThis role delivers all the functions to fulfill the requirements of an internal sales representative. This includes tasks such as answering phone calls from customers and prospective customers, processing incoming inquiries and sales orders, and preparing quotations and sales contracts.Target groupThe responsibilities of an internal sales representative (or customer service representative) include the following:- Answering phone calls from customers and prospective customers- Answering product, price, and order status related questions- Processing incoming inquiries and sales orders- Preparing quotations and sales contracts- Taking sales orders and ensuring successful order processing – for example, taking care of the completeness of sales documents, releasing delivery-blocked orders, and so on - Support for the outside sales force – for example, checking on quotations, updating customer master data, and so on- Preparing reports and sales analyses for the sales manager and the sales teamWork overview This work center gives you an overview of your daily work and gives you easy access to your most important tasks. Sales documents This work center allows you to work on all your sales documents. You can create and maintain inquiries, quotations, sales orders, sales contracts, scheduling agreements, and billing documents. Order fulfillment This work center allows you to monitor order fulfillment. You can display deliveries, backorders, and shipments, and can check product availability.Master data This work center enables you to work on all your master data. You can create and maintain business partners, customer agreements, prices and conditions, and products.
    I hope it will help you
    Regards,
    Murali.

  • Difference between business process, sales process and order process

    what is the difference between business process, sales process and order process?

    Dear Gopala,
    business process is a general definition of the process which you have:
    for example, you get an order, you have no goods, but you can produce them, you start an assambly processing, the production order will be created, then the goods will be prepatred, then the delivery will be created, the goods issue booked then your customer gets thwe goods and send the delivery confirmation, you create an invoice etc.etc.
    sales process is a part of  a business process.
    Sales process shows how you sell the goods, there are different sales document  categories to do this: sales orders, contracts, scheduling agreements etc.
    order process is only one of possibilities of the sales process.
    Order process is used if you get really a one-time (or at lease not on a regular basis many times) the simple orders where your customer says what goods he would like to receive and when. Then you create a sales order (in dialog transaction VA01) and can create a delivery. There are different types of sales orders in the standard. The customizing of sales order types is available under the transaction VOV8.
    I hope, this info help you a little bit further to understand SD design.
    Kind regards,
    Akmal Vakhidov
    Development Support SD, SAP

  • Difference between SY-SUBRC EQ 0 and SY-SUBRC EQ ' 0 '

    Dear All,
    I am not from abap background.
    I have a simple question.
    what is the difference between sy-subrc eq 0 and sy-subrc eq '0'
    How does it impact a statement like this for example
    SELECT /BIC/ZAGENT /BIC/ZBATCH_MO /BIC/ZDOC_NUM /BIC/ZCUSTOMER
               /BIC/ZSTORE /BIC/ZLINE_NUM /BIC/ZMATERIAL /BIC/ZBARCODE
          FROM /BIC/AZO_AMVN100
          INTO CORRESPONDING FIELDS OF TABLE it_aquisition
          WHERE /BIC/ZAGENT EQ SOURCE_FIELDS-/BIC/ZAGENT
          AND /BIC/ZDOC_NUM EQ SOURCE_FIELDS-/BIC/ZDOC_NUM
          AND /BIC/ZOCFLAG = '1'.
        if sy-subrc EQ '0'.
          SELECT SINGLE /BIC/ZDOC_NUM FROM /BIC/AZO_PMVN300
            INTO v_docnum
            WHERE /BIC/ZDOC_NUM EQ SOURCE_FIELDS-/BIC/ZDOC_NUM
            AND /BIC/ZAGENT EQ SOURCE_FIELDS-/BIC/ZAGENT
    kindly help me with this.
    Pleae do a little more research before posting questions here...even if you are new to ABAP.
    Edited by: kishan P on Aug 24, 2010 10:00 AM

    Hi,
    Please refer [Wiki post|http://wiki.sdn.sap.com/wiki/display/ABAP/Sy-Subrc].
    hope it help you,
    regards,

  • What's the difference between a not-initialed object and a null object

    hi guys, i wanna know the difference between a not-initialed object and a null object.
    for eg.
    Car c1;
    Car c2 = null;after the 2 lines , 2 Car obj-referance have been created, but no Car obj.
    1.so c2 is not refering to any object, so where do we put the null?in the heap?
    2.as no c2 is not refering to any object, what's the difference between c2 and c1?
    3.and where we store the difference-information?in the heap?

    For local variables you can't have "Car c1;" the compiler will complain.That's not true. It will only complain if you try to use it without initializing it.
    You can have (never used, so compiler doesn't care):
    public void doSomething()
       Car c1;
       System.out.println("Hello");
    }or you can have (definitely initialized, so doesn't have to be initialized where declared):
    public void doSomething(boolean goldClubMember)
       Car c1;
       if (goldClubMember)
           c1 = new Car("Lexus");
       else
           c1 = new Car("Kia");
       System.out.println("You can rent a " + c1.getMake());
    }

  • What is the difference between SAP NW PI7.1 and PI7.1 EHP1

    We have a customer using SAP PI7.1 EHP1. The application to be deployed
    isdeveloped on SAP Netweaver PI 7.1 SP06.
    We need to know if application developed and transported from PI7.1 is
    compatible with EHP1?
    Below are the Components used by the application .
    1) SSL communication using SOAP adapter
    2) Java mapping , Graphical mapping , XSLT mapping
    3) Customised EJB modules
    4) Adapter framework
    5) ALE layer for IDoc communication from ERP to PI
    6) RFC lookups to PI system and ERP system.
    Questions
    1)Will PI EHP1 be able to communicate with PI7.1 using SOAP adapter ?
    2) What is the difference between SAP NW PI7.1 and PI7.1 EHP1 ?
    Regards,
    Sneha

    Hi,
    EHP Pi7.1 new
    IPv6 Support in SAP Systems (new)
    Async/Sync and Sync/Async Bridge in the JMS Adapter (New)
    High Availability (New)   Locate the document in its SAP Library structure
    Use
    A new concept is available for setting up a high availability environment for SAP NetWeaver Process Integration (PI). To do this, you need SAP Web Dispatcher for load balancing, and you must reconfigure your HTTP, RFC, and RMI connections so that they can be used for load balancing. You must also make various configuration steps in other components of your PI environment.
    [Level 4: Document: XML to Text Conversion Module (New)] XML to Text Conversion Module (New)
    Message Packaging (New)
    Monitoring Milestones (New)   Locate the document in its SAP Library structure
    Use
    You can use the new scenario variant Monitoring Milestones of the Business Process Management scenario to define a monitoring process that can monitor events from different applications. A monitoring process can subscribe to events from SAP or non-SAP systems.
    check  given Link
    http://help.sap.com/saphelp_nwpi711/helpdata/en/61/8c3842bb58f83ae10000000a1550b0/frameset.htm
    Regards,
    Amit

  • What is the difference between component(Y, Pb, Pr) and component(R,G,B)?

    [I previously posted this question in another thread as hadn't realised how to post new question]
    Q. What is the difference between component (Y, Pb, Pr) and component (R,G,B) ?
    I’d previously thought I was reasonably savvy on all things HD, but when I turned my thoughts to looking into getting a mac mini to run part of my home cinema I realise I have some confusions around the above.
    Here’s what I think I know:-
    The mac mini has a DVI output of the type which can output both digital and analogue, and so via physical adapters it could be used to connect to displays that take HDMI or VGA style RGB leads.
    I know on the market I can get a DVI to Component cable lead which would therefore lead me to assume it could drive my HD plasma with component input (Y,Pb,Pr), as I currently drive the HD TV via component cable with a SKY HD box (720p and 1080i), an xbox 360 (720p) and a progressive scan DVD player (480p), all through a Denon AV-amp.
    The problem is, I’ve heard somewhere that the DVI to component is R,G,B only and that it is not Y, Pb, Pr which is making me wonder it a) this will work and b) if I really understand component video afterall.
    I notice the Apple TV outputs Y,Pb,Pr but colours them red, green and blue, so am even more confused….
    Hopefully someone can help educate me on this !

    Thanks for this.
    My Plasma is a Panasonic 42" Viera March 2005 model. No HDMI, No VGA.
    It can process signals up to 720p and 1080i via the component (an interestingly it makes a huge difference over SD even though the native panel is 480..!?!)
    Am I right in thinking that the iPod component cable will also be R,G,B and therefor might be a suitable trial? Ie. if the TV accepts the input from the iPod then it should work for the mini?
    Only other thing of note is I'm doing all this via my Denon 1707 AV amp which does have the facility of upscaling, but I imagine it needs to stick to one format?
    Thanks.

  • Difference Between SAP ECC 6.0 and SAP Solution

    Dear Experts,
       We are in the process of implementing a new SAP Structure.
        We are taking a hosted model from vendor which is called SBH (Subscription Based Hosting) of SAP Solution
      So my question to all experts is that, what is the exact difference between SAP ECC 6.0 and SAP Solution SBH model.
       If any comparison chart,  it would be helfull.
    Do reply asap.
    Thanks in advance,
    Nilesh Jain

    Hi Nilesh,
    Looking at the image below, you will find out that ECC6 is under SAP ERP, and SAP ERP is under SAP Solution:
    SAP solution is of a bigger element and ECC 6 is a component of it.
    Regards,
    Rod

  • Difference between Reports in normal ABAP and Reports in CRM

    Hi Experts,
    I am new to CRM. Can someone tell me the Difference between Reports in normal ABAP and Reports in CRM.
    It will be very useful if someone explains with example.
    Some where in SDN i read in CRM we should not select statment. Then how to fetch data?
    Please give me more basic concepts about CRM programming.
    Thanks,
    RAGU

    Hi Ragu,
    You can find much information at http://service.sap.com/crm-inst.
    Go to Installation & Upgrade Guides -> SAP Business Suite Applications -> SAP CRM
    Check the CRM version in which you are working and get the documents.
    FMs are specific to the requirement. Like all Business Partner related FMs generally start with BUPA* or BAPI_BUPA*.
    For CRM transaction data you can get info using FM CRM_ORDER_READ. To create a new transaction use CRM_ORDER_MAINTAIN and CRM_ORDER_SAVE.
    More information can be fetched by surfing through the SDN threads and checking in SE37 t-code.
    Hope this helps!
    Regards,
    Saumya

Maybe you are looking for