Defining my own types

What i want to do i create class that is called "Company" and with in the class there should be an array that contains multiple data:
Example:
Class Company{
Myowndatatype{
date date;
int price;
int time;
Myowndatatype[] = new Myowndatatype();
How is this best done in java, should i use an interface, or just make another class or what?

Why is a List better to use then a old school array? Is not an array much faster?List is "better" because it offers a more extensive, easy-to-use API and automagically handles a lot of the manual mess associated with dealing with arrays. Whether an array is faster or not is in all likelihood the completely wrong question to ask; better to worry about writing clean, simple, well-designed, easy-to-read code. Chances are better than excellent that Java's List implementations will be far more than fast enough.
~

Similar Messages

  • Defining your own type in java...?

    is there anything similar to C's enum in java for defining your own types?
    i.e. id like to make my own boolean type which isnt restricted to just true or false, but rather can be also undefined.
    any help will be appreciated

    That has nothing to due with C's enum construct.
    No there isn't. I think it will be in the next
    version.
    Have a look here how to make one:
    http://developer.java.sun.com/developer/Books/effective
    ava/Chapter5.pdfic, so iz it something like generics?

  • No special G/L acct defined for acct type K sp.G/L ind. Y recon.acct

    Hello Friends,
    When we used transaction F-48 for down payment of supplier, but on process we found error " No special G/L acct defined for acct type K sp.G/L ind. Y recon.acct XXXXXX.
    I have checked transactions FBKP & OBYR and entries are maintained for "acct type K sp.G/L ind. Y .
    Please suggest.
    Best regards,
    Jeetendar

    Hi ,
    Its looks like  you have defined your own Special GL indicator . Can you Please check in OBYR the properties of Y indiactor . Please see below 2 screen shot and check your Y as below . If this doesnot solve can you Please Paste the full error in Screen Shot.

  • Define exchange rate types according to ledgers

    Hi Everyone,
    I am facing a problem about the exchange rate types.
    I want to set different exchange rate types for my leading ledger and local ledger.
    for example, the leading ledger 0L is defined for IFRS with default exchange rate type M.
    the local ledger LL is defined for our country China and i want to use own-defined exchange rate type say Y001.
    is it possible realize like this in SAP.
    thank you so much!
    regards,
    samson

    Hi, Samson:
    I am not sure whether it make sense to have different exchange rate for same two currencies in different countries, for example, in China and US, exchange rates for RMB and USD are different in same situation, like buy-in...
    Your question about exchange rate definition in Non-Leading Ledger - it is impossible to do that in Define and Activate Non-Leading Ledgers.
    For the purpose of Ledger approach for parallel accounting, it is used to meet the reporting requirements basically, for example, IFRS or USGAAP or HGB, but not for exchange rate type...
    If you get any surpurise information, please share with me. Thanks.
    Best Regards, Lawrence

  • User exit Used while defining the storage type

    Hi all,
      Can anybody tell me about the user exit Used while defining the storage type.
    or what is the user exit name?
    i want to define my own strategy.
    i.e combine manual sut entry with strategy 'k'

    HI all I Got the Exit     MWMTO003.
    Now  ,
    Following Logic is to be built. (Storage type strategy is K for putaway.)
    u201CManually selection of SUTu201D while Putaway , For Strg -K SUT selection is
    system guided.
    Which componant is required for this. Pls guide.
    Is the above requirement is possible?
    Edited by: dev .. on Feb 19, 2009 1:58 PM

  • Style Elements - defining your own ?

    hi,
    I have a list of typography elements to define styles
    for - can map most to 'heading1', 'heading2', 'Portlet
    Header', etc. style elements in the portal style.
    however, to make more meaningful names for our site -
    e.g. 'Content Header', 'copy text' etc - would be
    useful to define our own style elements (while still
    utilising the portal's 'edit style' page - don't want
    to have to resort to our own css style sheets).
    I have used item attributes to force new elements on
    the Item Element Type - and this will work (exposes
    our own defined style elements in the style sheet, and
    allows our own naming system).
    question is - are there any other ways of achieving
    this? has anyone else done something similar?
    also - can we rename 'heading1','heading2' etc to
    our own more meaningful names?
    also - anyone else think it would be useful to be
    able to specify pixels as well as point for font
    size?
    thanks
    kev

    That has nothing to due with C's enum construct.
    No there isn't. I think it will be in the next
    version.
    Have a look here how to make one:
    http://developer.java.sun.com/developer/Books/effective
    ava/Chapter5.pdfic, so iz it something like generics?

  • Define our own Exceptions in th function builder

    hi
    how to define our own Exceptions in th function builder in the Exception tab and how to use them in functon definiton.
    regards
    ravish

    Hi,
    <b>Exceptions</b>
    The exception of a function module are defined on the Exceptions tab page in the Function Builder. Here you can select exception classes to define whether class-based exceptions are declared or non-class-based exception are defined. Class-based exceptions are represented in the above syntax by RAISING, and non-class-based exceptions are represented by EXCEPTIONS.
    The addition RAISING is used to declare class-based exceptions that can be propagated from the function module to the caller. Exceptions in the categories CX_STATIC_CHECK and CX_DYNAMIC_CHECK must be explicitly declared, otherwise a propagation can lead to an interface violation. A violation of the interface leads to the treatable exception CX_SY_NO_HANDLER. Exceptions of the category CX_NO_CHECK are implicitly always declared. The declaration of exceptions of the category CX_STATIC_CHECK is statically checked in the syntax check. For exceptions of the category CX_DYNAMIC_CHECK, the check is not performed until runtime. In a function module in which class-based exceptions are declared with the RAISING addition, the statement CATCH SYSTEM-EXCEPTIONS cannot be used. Instead, the relevant treatable exceptions should be handled in a TRY control structure.
    The addition EXCEPTIONS is used to define a list of non-class-based exceptions that can be triggered in the function module using the statements RAISE or MESSAGE RAISING. Exceptions defined in this way - as with formal parameters - are bound to the function module and cannot be propagated. If an exception of this type is triggered in a function module, and no return value has been assigned to it with the homonymous addition EXCEPTIONS of the CALL FUNCTION statement when the call was made, this leads to a runtime error.
    <b>Note</b>
    For new developments after release 6.10, SAP recommends that you work with class-based exceptions that are independent of the function module.
    Regards,
    Padmam.<b></b>

  • How to define our own selection screen for logical database  in abap-hr?

    Hi Friends,
    Can u please help me
    How to define your own selection screens for  logical database.
    we use to do like(goto->attributes-HRReportcatagerious ).but How to desin using  customer table like t599c, t599f and how to add to my logical database?
    Thanks in advance
    charan

    check out this online help
    http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba65c35c111d1829f0000e829fbfe/frameset.htm
    Regards
    Raja

  • Error in saving customer information. Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE.

    I was trying to create a text alert. I was calling following in jsp
    email.setContactPointPurpose(myLookUpCode); //say XXMY_SMS_SHIP
            PartyManager.createEmail(email, ApiConstant.CONTACT_POINT);
    Getting following exception:
    Error in saving customer information.
    Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE.
    Error trace:
    oracle.apps.ibe.customer.CustomerException: Error in saving customer information. at oracle.apps.ibe.tcav2.Email.create(Email.java:187) at oracle.apps.ibe.tcav2.PartyManager.createEmail(PartyManager.java:116) at _oa__html._myfile__ibeMyFile._jspService(_myfile__ ibeMyFile.java:908) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:662) Caused by: oracle.apps.jtf.base.resources.FrameworkException: Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE. at oracle.apps.jtf.util.ErrorStackUtil.getFrameworkException(ErrorStackUtil.java:104) at oracle.apps.jtf.util.ErrorStackUtil.getDBFrameworkException(ErrorStackUtil.java:141) at oracle.apps.ibe.tcav2.Email.create(Email.java:185) ... 11 more Error in saving customer information. oracle.apps.jtf.base.resources.FrameworkException: Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE. at oracle.apps.jtf.util.ErrorStackUtil.getFrameworkException(ErrorStackUtil.java:104) at oracle.apps.jtf.util.ErrorStackUtil.getDBFrameworkException(ErrorStackUtil.java:141) at oracle.apps.ibe.tcav2.Email.create(Email.java:185) at oracle.apps.ibe.tcav2.PartyManager.createEmail(PartyManager.java:116) at _oa__html._myfile__ibeMyFile._jspService(_myfile__ ibeMyFile.java:908) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:662) Value for contact_point_purpose must be a value defined in lookup type CONTACT_POINT_PURPOSE.

    Tried this but it is giving the below error
    APP-FND-01242: Cannot read value from field PER_ASSIGNMENT_ID
    Cause: The field PER_ASSIGNMENT_ID could not be located or read.
    Action: This error is normally the result of an incorrectly-entered field name string in a trigger, or a field name string that does not uniquely specify a field in your form. Correct your trigger logic to precisely specify a valid field.

  • Defining New product type in CRM 5.0

    Hi Guys,
    Can anyone tell me how to define new Product Type for CRM(Standalone Products) like material, Service, warranty, financing .
    Thanks in advance
    amar

    Hi Kovela,
    I haven't come across any IMG activity which allows to create a new product type in CRM. Why do you want to have a separate product type. It is not so easy to create a product type because you also need to create additional attributes and set types. In general all existing product types are stored to table COMC_PR_TYPE. Also you need to maintain a separate structure (COMT_PROD_MAT_MAINTAIN_API) for each product type.
    Why don;t you enhance the existing product type by creating new attributes and set types as per your requirement.
    <b>Do not forget to reward if it helps,
    </b>
    Regards,
    Paul Kondaveeti

  • How to define reporting time types for 0HR_PT_2 to populate records in rsa3

    hi experts,
    we are implementing Time and Labour and we are using info provider called 0PT_C01.
    for that we have 2 data sources one is 0HR_PT_1 and 0HR_PT_2.
    when i check in RSA3 there are records for 0HR_PT_1 Data source, but for 0HR_PT_2 data source it shows 0 records though the related info types have data.
    i have checked in sdn for the solution, most of the replies are related to maintain Reporting Time Types.
    can you please provide me step by step solution to maintain Reporting Time Types in ECC.
    Regards
    venuscm

    Hi Venu,
    You can maintain reporting time types in SPRO,
    SPRO > Integration with Other SAP Components -> Data Transfer to the SAP Business Information Warehouse -> Settings for Application-Specific DataSources (PI) -> Human Resources -> Actual Employee Times OHR_PT_02 -> Define Reporting Time Types -> Maintain Reporting Time Types
    Check with your HR team about maintaining reporting time types.
    [http://help.sap.com/saphelp_46c/helpdata/fr/e8/cb2d28e4ded31184080004aca6e0d1/content.htm]
    Regards,
    Durgesh.

  • Logical System Name is defined for which type of Business Sytem

    hi
    Can some one helps me on this question and explaination.
    Logical System Name is defined for which type of Business Sytem ?
    a.Third Party
    b.Web AS java
    c.WebAs abap
    d.Standalone java
    Thanks
    Chandra

    Hi ,
    Logical System Name is defined for the Business System type WebAS ABAP.
    It is used in ALE scenarios when exchanging IDOCs between the particular system and XI.  The IDOC adapter will pick up the information from the SLD and it can then be used in the configuration in the Communication Channel (Adapter Specific Identifiers).
    Refer to this How-To Guide for more info
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09b775e-e56e-2910-1187-d8eba09c7a4a
    Regards
    Manish

  • Down Payments Error: Account type K is not defined for document type DZ T

    I am getting the error message: Transaction code: F-29
    Account type K is not defined for document type DZ
         Message no. F5243
    In this case i am trying to post a customer down payment in t.code:  F-29.
    In the document type DZ in OBA7 we tick only G.L and Customer tab as this is not a vendor document.
    Also the settings in T. Code : OBXR where we maintain configuration for customers has been maintained with a special G/L reconciliation account.
    any help will be really appreciated,
    Regards
    Satish

    I have checked all the settings
    OBXR for Customer Down Payments. It is with indicator A and a Special G/L Account has been configured.
    The special G.L Account is of the Recon account type Customers with FSG as Recon accounts
    The document type DZ in OBA7 is ticked for G.L and Customer and this is how i think it should be as i am not paying a vendor downpayment
    but it still gives me the same error.
    Regards
    Satish

  • Define Withholding Tax Type for Payment Posting

    Hey Guys, I'm configuring Withholding Tax for a company. I know the purpose for defining the withholding tax type for invoice posting, but do understand where is the Withholding tax type for payment posting used? Is it used for advance(down) payment or something else?
    Thanks,

    Hi ,
    In some countries there is requirement that you need to deducted Withholding tax either at time of Invoice or payment which ever is ealier . so if you get Invoice first then you deduct the Withholding tax on Invoice and define the tax type and assign to company . but if you make paymnet first which we called advance or down payment then we configure Withholding tax on payment .
    If a vendor is liable for withholding tax on invoice it may be liable for payment as well if you think you may pay some advances .
    Please let me know if you need more information

  • Order Reason ABC not defined for Order Type Retrun order

    Hi
    I am getting following " Message no. V1 899 " when i am  doing return order without refernce .
    Order reason is defined in customization but still we are getting the following message " Message no. V1 899 " /Order Reason E18 not defined for Order Type ZEF9.
    Can any one help me
    regards,
    kiran

    Hi Kiran
    As you have created sales order with document type ZEF9 but you have not taken any reference document then go to VOV8 and select ZEF9 and maintain  the order reason feild and then do the process
    Regards
    Srinath

Maybe you are looking for

  • Experts! did u face this prob!

    I want to give the user a flexibility to filter the data using select-options. But, I want to give it in a Dialog/screen. Not in a Selection-screen!! Please understand the difference between selection-screen(automatically generated screen) and screen

  • Creating a interactive product demo in flash?

    Hi All, I have to create a interactive produc demo for one of the product, I have created every thing except the product rotation feature, I mean end user can rotate the product in 360 degrees as per the their wish using mouse. I have all sides of im

  • How I create a label with drag and drop?

    I have the next... I want to be able to move to a label (drag and drop) of swing in my panel contained in jframe. I already identify the position of the mouse with the method mouseMoved With the method ---jButton1ActionPerformed--- that I assign to e

  • My online number doesnt work

    Deae SKype: my +*edited for privacy* number doesnt work since i bought. The message i left , i didnt get reply. But i have keep paying the service. please reply :*edited for privacy*

  • Kozuka Font Question

    I have several versions of Kozuka installed on my Windows PC running XP Home and CS3.  Kozuka is usable via Word and I can see the same versions when using AdobeType Manager. However, using InDesign, these fonts are not available to me. Can anyone sh