Novice question: ArrayList error

Two classes: Bank and Customer.
Customer class has this constructor:
public class Customer {
protected String cust_name;
protected int card_number;
protected double current_bal;
protected double credit_limit;
public Customer(String ID, int CCN, double balance, double limit) {
cust_name = ID;
card_number =  CCN;
current_bal = balance;
credit_limit = limit;
}Bank class has an ArrayList of Customer objects.
import java.util.ArrayList;
public class Bank extends Customer
ArrayList<Customer> customers = new ArrayList<Customer>();
/* here is the error on below line: compiler outputs "<identifier> expected"
customers.add(new Customer("Nicholas Cage", 345, 225.0, 2600.0));Is it wanting an identifier in the add method? (i.e. customers.add(1, new Customer....)

customer object being added to the arraylist is fine..u should have the customers.add() within a method...where you have that customers.add()?
if its within a methed then just verify if the braces above are closed properly b'coz this error might come if the braces are not closed properly..

Similar Messages

  • Java Novice Question (don't shoot me)

    Hello,
    I wanted to ask a very novice question, that I can't seem to find an answer to.
    I have Eclipse IDE for Java, and I also have Visual Studio (C#). In Visual Studio, you can create a application project, drag and drop a button, then double click the button tod be taken to the code behind the button, that's where you insert your code on what you want the button to do once you click it.
    Is there something similiar to that in Java (I know there must be), where you can drag and drop textboxes, buttons, etc., and then double click those items to code?
    Any light that ANYONE can shed on this would be highly appreciated!
    Thanks!
    Waleed

    waldo33 wrote:
    Okay, thank you for the patience! I will download the "kitchen sink" version, and by that I assume you mean the biggest Netbeans file :)Yeap.
    Regarding "building a website"...by that I mean...I want to build a simple website, which incorporates (MySQL which I already installed, installed the ConnectorJ, etc.), a front end (JSP would be nice, which i'm learning), and ofcourse the backend Java coding.Right. Thats not what I got from your first message. I thought your were simply after create a rich client (I.e. Java Swing). Creating a web site is a more advanced topic. I don't know of any GUI editors for it, but then I don't do it (I half expect someone to post IntelliJ IDEA now). But we are just talking HTML and lots of HTML editors exist.
    I don't care how easy the website, as long as I can learn (on a basic level). You are going to have to look up tutorials on Java EE.Personally I don't think this is a "new to java" topic.
    (Scary, covers all of JEE) [The Java EE 5 Tutorial|http://java.sun.com/javaee/5/docs/tutorial/doc/]
    Re: "Right tool for right job"...are you suggesting that I have Eclipse for coding Java, and NetBeans for more GUI apps and developement?The UI for rich clients I do in NetBeans. Everything else I do in Eclipse. But this is just me, and I'm luck enough to be able to dictate tool chains.

  • Another questions of error -61017

      I have posted the questions of error -61017, after thinking more deeply, I think the error of -61017 maybe due to I have fully use the FPGA to RT FIFO. Will such error occurs when the FPGA to RT FIFO is full? 

    Please attach this to the original Thread.
    Thanks

  • Data transfer with some errors on registers. (Novice question)

    Hi experts.
    First of all i wat to say that i'm realtively novice in BW.
    I have an ods object.  I have a transformation>Data Transfer Processes>Infopackage to load data to it.
    I execute this with a process chain.
    well the roblem is that some registers I get are erroeous. That's ok, i just want lo load the OK regs, but when this happens the sistem does't load any.
    I want to load only the good registers and be reported about the errors too.
    Can someone please give me some advice about this?? I think thje secret is in the error handling customizing on the DTP, and maybe create a error DTP and something in the infopackage.
    Any tip to me please?
    Thank you!!!

    Hi,
    you need to maintain some parameters in the update tab of  the dtp.
    a) set the error handling to update valid records, reporting possible (request green)
    b) enhance the no. of error records to the size of the data packet.
    c) create a error dtp
    Now all records without error will be updated, the request will be green and so available for reporting. The records with errors will go to the error stack and can be edited there. The records of the error stack will be updated thru a error dtp.
    regards
    Siggi

  • A question about error with jasperserver for pdf and Apex

    I have created a pdf report on jasperserver and I can call it from apex via a url and it displays fine. The url is this format {http://server:port/jasperserver/flow.html?_flowId=viewReportFlow&reportUnit=/reports/Apex/deptemp&output=pdf&deptNo=#DEPTNO#&j_username=un&j_password=pw}
    However, I am trying to follow a stored procedure executed from Apex so it would not expose the username/pwd in the url like above.
    If I am reading the apache error log correctly it is erroring in this piece of the code below where it executes {Dbms_Lob.writeAppend}
    loop
    begin
    -- read the next chunk of binary data
    Utl_Http.read_raw(vResponse, vData);
    -- append it to our blob for the pdf file
    Dbms_Lob.writeAppend
    ( lob_loc => vBlobRef
    , amount => Utl_Raw.length(vData)
    , buffer => vData
    exception when utl_http.end_of_body then
    exit; -- exit loop
    end;
    end loop;
    Utl_Http.end_response(vResponse);}
    The error log says this; HTTP-500 ORA-14453: attempt to use a LOB of a temporary table, whose data has alreadybeen purged\n
    What is this error telling me and how can I correct it?
    The stored procedure I am following is below but replaced the vReportURL with my url like above that works.
    Thank you,
    Mark
    {CREATE OR REPLACE procedure runJasperReport(i_deptno   in varchar2)
    is
    vReportURL       varchar2(255);
    vBlobRef         blob;
    vRequest         Utl_Http.req;
    vResponse        Utl_Http.resp;
    vData            raw(32767);
    begin
    -- build URL to call the report
    vReportURL := 'http://host:port/jasperserver/flow.html?_flowId=viewReportFlow'||
         '&reportUnit=/reports/Apex/deptemp'||
         '&output=pdf'||
         '&j_username=un&j_password=pw'||
         '&deptNo='||i_deptno;
    -- get the blob reference
    insert into demo_pdf (pdf_report)
    values( empty_blob() )
    returning pdf_report into vBlobRef;
    -- Get the pdf file from JasperServer by simulating a report call from the browser
    vRequest := Utl_Http.begin_request(vReportUrl);
    Utl_Http.set_header(vRequest, 'User-Agent', 'Mozilla/4.0');
    vResponse := Utl_Http.get_response(vRequest);
    loop
    begin
    -- read the next chunk of binary data
    Utl_Http.read_raw(vResponse, vData);
    -- append it to our blob for the pdf file
    Dbms_Lob.writeAppend
    ( lob_loc => vBlobRef
    , amount  => Utl_Raw.length(vData)
    , buffer  => vData
    exception when utl_http.end_of_body then
    exit; -- exit loop
    end;
    end loop;
    Utl_Http.end_response(vResponse);
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-length: ' || dbms_lob.getlength(vBlobRef));
    owa_util.http_header_close;
    wpg_docload.download_file(vBlobRef);
    end runJasperReport;
    /}

    I am new to working with working with jasperserver to apex interfacing, and also using utl_http with binary data.
    But I guess typing my question down helped me figure out a way to make it work for me.
    I combined info from http://www.oracle-base.com/articles/misc/RetrievingHTMLandBinariesIntoTablesOverHTTP.php
    and from http://sqlcur.blogspot.com/2009_02_01_archive.html
    to come up with this procedure.
    {create or replace PROCEDURE download_file (p_url  IN  VARCHAR2) AS
      l_http_request   UTL_HTTP.req;
      l_http_response  UTL_HTTP.resp;
      l_blob           BLOB;
      l_raw            RAW(32767);
    BEGIN
      -- Initialize the BLOB.
      DBMS_LOB.createtemporary(l_blob, FALSE);
      -- Make a HTTP request, like a browser had called it, and get the response
      l_http_request  := UTL_HTTP.begin_request(p_url);
      Utl_Http.set_header(l_http_request, 'User-Agent', 'Mozilla/4.0');
      l_http_response := UTL_HTTP.get_response(l_http_request);
      -- Copy the response into the BLOB.
      BEGIN
        LOOP
          UTL_HTTP.read_raw(l_http_response, l_raw, 32767);
          DBMS_LOB.writeappend (l_blob, UTL_RAW.length(l_raw), l_raw);
        END LOOP;
      EXCEPTION
        WHEN UTL_HTTP.end_of_body THEN
          UTL_HTTP.end_response(l_http_response);
      END;
    -- make it display in apex
    owa_util.mime_header('application/pdf',false);
    htp.p('Content-length: ' || dbms_lob.getlength(l_blob));
    owa_util.http_header_close;
    wpg_docload.download_file(l_blob);
      -- Release the resources associated with the temporary LOB.
    DBMS_LOB.freetemporary(l_blob);
    EXCEPTION
      WHEN OTHERS THEN
        UTL_HTTP.end_response(l_http_response);
        DBMS_LOB.freetemporary(l_blob);
        RAISE;
    END download_file; }
    Don;t know what I did wrong, but I could not create an 'on-demand' process to call my procedure. I did not understand what it means when it says 'To create an on-demand page process, at least one application level process must be created with the type 'ON-DEMAND'.
    so I had to use a blank page with a call to my procedure in the onload - before header process and that seems to work ok.
    Thank you,
    Mark

  • Strange question mark error while opening pdf files in adobereader from SAP

    Hi Gurus
    We are having a strange intermittent problem with Adobe Reader. When we try to open PDF files from SAP Frontend we get an error pop-up. The pop-up does not have any text. The title of the pop-up has "Adobe Reader". There is a blue question mark and an OK button.
    This issue occurs few times a day
    This issue does not occur in Windows XP.
    Since past few weeks, we have been trying to find some error/warning/atleast some text in log files of SAP, OS, Adobe Reader, Registry entries, Event Viewer. So far, we have not found anything.
    SAP is not able to help as this issue occurs intermittently and said when they tried, the issue did not occur. They made two attempts and in each attempt they tried 10 times to reproduce the issue. This issue occurs intermittently.
    Environment
    SAP R/3 4.7 EE SAP_Basis 620 Support Package 61
    Windows Vista Enterprise
    Adobe Reader 9.0 and Adobe Reader 9.1 (tried with both versions)
    SAPGUI 710 Patch 12 (latest patch). It also occured in Patch 11. 
    Please suggest
    Thank you
    Pavan

    Thank you for the quick reply.
    We tried many notes from Service Market Place. Also, Windows Team is in contact with Adobe.
    As per Adobe's suggestions, we tried changing preferences of Adobe Reader. We think it might be a problem with SAP Frontend.
    Present status - Issue still exists. nothing works.
    Thank you

  • Big X with question mark error

    I have been working on a presentation for weeks and today after trying to print my slides, I found an error on a slide, edited it and all of a sudden the background went away and became white. The text and photo were still on the screen, but everything was gray and there was a big X going from the corners of the slide and where it intersects in the middle was a question mark. Talked to tech support and they didn't know what it was. Everytime I wanted to edit a slide, it did that. I ended up restoring to a backup that Time Machine had made, but what happened????

    I have been having the same problem aswell... Even though none of my original files have moved or been renamed. Can't answer your question, but hopefully we'll find the answer.

  • Oracle 8i Question Compile Error

    I have used the following code before on a 10g db but I am having problems getting it to compile on 8.1.7.4 Im pretty sure it should still work thought.
    create or replace procedure bulk_load as
    cursor c1 is
         select * from schema.table;
    TYPE t_select IS TABLE OF c1%ROWTYPE;
         t_data t_select;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 BULK COLLECT INTO t_data LIMIT 1000;
         FORALL i in 1..t_data.COUNT
         INSERT INTO schema.table VALUES t_data(i);
         exit when c1%NOTFOUND;
         end loop;
    commit;
    close c1;
    null;
    end;
    Line: 13 Column: 28 Error: PLS-00597: expression 'T_DATA' in the INTO list is of wrong type
    Line: 13 Column: 1 Error: PL/SQL: SQL Statement ignored
    Line: 15 Column: 63 Error: PLS-00518: This INSERT statement requires VALUES clause containing a parenthesised list of values
    Line: 15 Column: 2 Error: PL/SQL: SQL Statement ignored
    Line: 15 Column: 2 Error: PLS-00435: DML statement without BULK In-BIND cannot be used inside FORALL
    Line: 14 Column: 11 Error: PL/SQL: Statement ignored
    Any questions comments would be helpful
    Thanks
    Edited by: user11937852 on Jan 17, 2011 11:30 AM

    If I am not mistaken BULK COLLECT has to be done per column in 8i:
    open c1;
    fetch c1 bulk collect into collection_1, collection_2, ...;

  • Answer to question about "Error Occurring when convertion is tried for PDF to Word Document"

    There are about ten questions about the "Error Occurring" when  using Abode Reader XLto convert a PDF to a Word Doc, but no one has the answer? It has something to do with "signing in  the wrong address". I have been working on this three days Now! Soimeone has the answer? Cataloochee

    You must be kidding to say, "Adobe doesn't convert any version of Adobe Reader."'  I must be in another world! When i move an Adobe Reader file pdf that goes to a wIndow that the top line says,'' Adobe reader X1 1001 Early Dutch History. pdf ". Then i click on the far left yellow marked icon that is used to move 1001 Early Dutch History.pdf to thye far right into a gray colored slot that reads "1001 Early Dutch History.pdf'. Under the file above  or down below, the selected File for conversionis, a selection gray slot that ask if you want to convert this file(pdf) to a .docx.,.doc, tex. or Excell. After I make the selection and click onto Convert, a message comes into view where the word convert was that reads "An Error Occurred wilth Signing In  OK" Even the use of another pdf file with a complete different address produces the same message. There are eight chapters in Dutch that I need to convert to word document by tommorrow or the class i teach "the Origin of Golf" will have to listen in Dutch and I can't speak Dutch. Cataloochee

  • 2 novice question

    Hi
    i have 2 question about premiere pro cs3
    1) import video , install Qlite http://www.free-codecs.com/download/QT_Lite.htm  can increase the video import or export feature ?
    2) i'm reallya  novice , i'm a photoshop cs3 user , can i with premiere pro cs3 edit the colors ? make some some part more dark like curve or selective colors ?
    thanks

    1 - For SD (Standard Definition) work, Premiere works best with DV AVI Type 2 files
    This cannot be stressed enough. This is the designed workflow for most NLE's, and holds for everything in the Premiere lineup. While some CODEC's can be worked with internally, most cannot. Conversion to DV-AVI Type II w/ 48KHz 16-bit PCM/WAV will always work best. Even if you have the proper CODEC and it's installed properly on the system, there is no guarantee that Pr can use it. In most cases, it's a certainty that they will not. Also remember that because a player on your system can play a file, there is a great difference between playing a file, and editing a file.
    2 - Look in the user guide you just downloaded to see what effects are available
    There are many Effects in Pr, that have a correlation to the adjustments in Photoshop, Brightness & Contrast, Highlight & Shadow, Levels and Luma Curves are but a few. The PremierePro-wiki is a great place to explore, after you read the guide from the link that John furnished. I'd suggest that one read all of the FAQ's and then start working through the tutorials. Do not limit your reading to just your version of Pr. Much from earlier and later versions will still apply, though you may have to look for a menu, or be aware of a name change someplace. With a little study, you'll find a lot of similarities between PS and Pr.
    Good luck,
    Hunt

  • Question about Error Statistics

    Hello,
    Just want to ask question, what cause of  Recieve Ignored packets and Throttles in Cisco Aironet 1310G  with System                                       Software Version:12.4(21a)JA, it increments the number very fast.
    Thanks you

    Wireless transmission acts similar to a wired hub.  One talks and everyone listens.  Wireless static errors can easily be attributed to retransmissions caused by the clients either too far away or too close (shadow).  Transmission errors also happens when there are just too many clients that associate to a specific AP.

  • Question about error-code in web.xml

    Can you use pattern matching for error-codes?
    Instead of
    <error-code>401</error-code>
    <error-code>403</error-code>
    <error-code>404</error-code>
    etc..
    you could just do
    <error-code>4*</error-code>

    I don't know a replacement for this, but I recommend to post this questione into Servlets section to get more chances for receiving answers...
    Regards,
    Mohammed Saleem

  • Captivate 4 - question slides - error message attached to Next button

    Hi there
    For users who may try to skip ahead and not take quiz questions, I wondered if there's a way to have an error message appear if they try to click Next without answering the question.

    Hi Alicia
    As you mentioned that the day you imported the audio into Captivate slides you started facing this issue. So try to export the audio from any one of the slide, save it on your desktop, create a new project in captivate, add an image, button on that slide and import the same exported audio. Observe that are you facing the same issue or not. If not, then try to copy and paste the slides in new project with same dimensions.
    Hope it helps
    Thanks
    VJ

  • Question, PSE09 Error

    PSE09, Windows 7 OS, when I attempt to edit an image I get this " "Some of the application components are missing from the application directory, please re-install the application".
    Was able to edit under old PC OS Vista, upgraded to Windows 7 and now this error? Have removed and re-installed the official PSE09 disc program twice. Error remains? Please advise.

    Hello PostOakSountdtrack, and Ali17
    Thank you for your post.
    These forums are specific to the
    Acrobat.com website and its set of hosted services, and do
    not cover support for the Acrobat family of desktop products.
    Any questions related to the Acrobat family of desktop
    products would be best suited in the Acrobat Forums:
    Link to
    the Acrobat Forums
    Thanks!
    Pete

  • Embarrassing ESSCMD question (re: error logs)

    Hi all you kind folks,This is one that is probably incredibly obvious, but I just can't find the answer. I use various ESSCMD scripts to load oodles of data into Essbase cubes. The data files are very large. My scripts are set up basically like this (simplified):OUTPUT 1 "dataload.log";IMPORT 3 "datafile1" 4 "Y" 3 "loadrules.rul" "N" "dataload.log";IMPORT 3 "datafile2" 4 "Y" 3 "loadrules.rul" "N" "dataload.log";...and so on. The problem is that after each data file loads to the cube, the error messages in 'dataload.log' are overwritten by the next data file's errors.When the script is finished, only the errors for the last data file are in theerror log. I need to be able to capture all the errors, for all the data files.My question: is there an Essbase setting somewhere that would let mespecify that the errors for successive data file loads be appended to theerror log, instead of overwriting it each time? Or do I just have to send theerrors for each individual data file to a separate log file? Thanks very much! gregp.s. I jacked up the DATAERRORLIMIT setting to 100 million, thinking thatthis was the problem - no luck.

    I think you made a confusion between the general log of your script (OUTPUT...) and the error log of each loading (for each loading line).As the error log is erased each time, I am affraid that you should mention a different error file for each loading.At the end, if you want, you can concatenate these files.Hope this helps.Denis ZubaTHESYS [email protected]://www.Thesys-Solutions.comT?l.: +41 21 653 56 12Mobile: +41 79 688 80 12

Maybe you are looking for

  • IChat no longer works in Lion

    Hey all, I recently upgraded to Lion and now my iChat is totally dead.  I can open the app but its impossible for me to sign in.  The buddy list hangs on my screen collapsed and says 'offline' When I swtich my status to available nothing happens.  I

  • Video Out to Firewire is not working

    I found that the internal speakers are not giving me a good sample of final output. I have a TV hooked up to a JVC Deck with FW in that I can use to judge sound. I used prefs to set up Video Out but it is not taking. I have quit all other apps that m

  • Page built with a table does not display well in Internet Explorer.

    In Chrome and Safari it appears correctly (items are left justified in each column) while in Internet Explorer all columns are centered. Website is www.eventpowerli.com and it is the home page where we have the issue. I am new to building websites so

  • PR should not change after PO generation

    Dear gurus, when i create a PR from  cj20n/cn22 with qty and rate and do the PO against that PR. Having created PO against the PR system is allowing us change the data in the PR(like Qty, Rate..etc.).but the requirement in my project  once the PR is

  • Firmware for mfp m175nw

    Where can I get the eprint firmware for Laserjet 100 MFP M175nw...