How can I set a value to an Object Array

I am declaring an object variable like this:
final Object[][] data = {
{"Mary", new Integer(5)},
{"Alison", new Integer(3)},
{"Kathy", new Integer(2)},
{"Sharon", new Integer(20)},
{"Angela", new Integer(4)}
And I would like to declare it like this:
final Object[][] data = new Object [6][3];
But the matter is that when I try to set a value like this:
          data[0][0] = "Hola";
I got the next Errors.
TableEditDemo.java:95: ']' expected
          data[r][c] = "Hola";
^
TableEditDemo.java:95: <identifier> expected
          data[r][c] = "Hola";
^
TableEditDemo.java:95: cannot resolve symbol
symbol : class data
location: class TableEditDemo.MyTableModel
          data[r][c] = "Hola";
^
3 errors
Could Somebody Help me please???? Thank you very much.

I don't see problem for your declaration. Is it possible you forgot to cast data back to whatever class?
PC

Similar Messages

  • How can I set a value of column in SSIS by using Replace

    How can I set a value of a column in SSIS using a Replace in Derive columns. I have here NameCode and I need to Set = 1 Where NameCode like LIKE '____99____'
    eg. 1006993010... if 5th and 6th characters are 99
    Else 0
    Hope to hear from someone soon and I appreciate great help here.

    If NameCode column is integer then you have to cast it correctly to String.
    I am adding that to the expression provided by Rajen.
    SUBSTRING((DT_WSTR,20)ProductCode,5,2) == "99" ? 1 : 0
    -Vaibhav Chaudhari

  • How can I set the value to a session bean from backing bean

    Hi Experts,
    How can I set the value to a session bean from backing bean where I have created getter and setter
    methods for that variable.
    Basically I am using ADFUtils class where I am able to get the value from session bean
    using following expression
    String claimType =
    (String)ADFUtil.invokeEL("#{ClaimValueObj.getClaimType}");
    Thanks
    Gayaz

    Gayaz,
    Wrong Post !!
    Post in JDeveloper and ADF
    Thanks
    --Anil                                                                                                                                                                                                                               

  • How can I set default values for Allocate Mode in AO config?

    Hi, How can I set default values for allocate mode in AO config. To be specific, in the attached vi, I need to set the Allocate Mode in AO Config to 'Use FIFO Memory (6)' if the value inside my case structure is false and to 'no change (0)' if the value inside the case strusture is true.
    Solved!
    Go to Solution.
    Attachments:
    generateWaveformFIFO.vi ‏15 KB

    Create two constants for the Allocate Mode input (right click > create > constant). Place one in the true case of the case structure, and place the other one in the false case. Wire them to the same tunnel (border of the case structure), then wire the tunnel to the Allocate Mode terminal of the AO Config. I don't have Traditional DAQ installed, but that should do it.
    Misha

  • How can i Set ArrayList values to selectOneListbox

    Please Let me know How can i Set ArrayList values to selectOneListbox dynamically from the managed bean

    Note: beanList is a list of selectItems
    ArrayList<SelectItem> beanList;

  • How can I set a value in a field before create when a New button is clicked

    Hi,
    I am using
    JDeveloper 10.1.3.1.0.3984 and
    JHeadstart 10.1.3.1 release 10.1.3.1.26
    I have one group and there is a detail group under that group.
    From main group to detail group there are 3 field relating those groups.
    field1
    field2
    fieldSEQ (auto-generated by database trigger)
    These 3 fields are PK.
    In the detail group, there is a New button. So, when the New button is clicked, it tries to create the record with those 3 fields value as those are coming from main group. As a result it's giving the duplicate error as that record already exists in the table.
    But I don't want to create the record with that SEQ as that will be created in the trigger.
    How can I set the SEQ temporarily any no. (-1) before create when the New button is clicked?
    Can anybody help?
    Thanks
    Syed Jabbar
    University of Windsor
    Windsor, ON, Canada

    Hello Syad,
    What I would suggest is setting the sequence number at the creation of the entity object (so in the create() method) by using the database sequence. This way it will always be unique.
    So something like:
    protected void create(AttributeList AttributeList) {
    super.create(AttributeList);
    SequenceImpl sequence =
    new SequenceImpl("KCP_SEQ", getDBTransaction());
    setFieldSeq( sequence.getSequenceNumber());
    If this still does not solve it: please go to the ADF Forum since this problem is an ADF problem, not a JHeadstart problem.
    Regards,
    Evert-Jan de Bruin
    JHeadstart Team.

  • How can I set default value to a transient parameter  in the VO

    I have created a transient parameter in the VO, which is type of boolean.
    When I try to input the "true" or "True" or "Y" in the 'default value',
    and then running the programm, but all failure.
    so I don't know how can i do.
    Genuinely waiting for you help, thanks in advance.

    Hi Sumury,
    First of all you could check if this transient attribute is read only. to check this, edit the VO and select the transient attribute under the Attributes tab. Then verify if it is marked as "Updateable Always" on the right-hand section.
    If it is updateable, then try setting the default value on the VO Implementation class: open the xxxVOImpl class, go to the transient attribute's setter (setxxx()) and change it to:
    <code> if (getXXX() == null) setAttributeInternal(XXX, "Y");
    else setAttributeInternal(XXX, value);</code>
    This might work. If it does not, then please post the exact message you are receiving when running the app.
    Hope this helps!
    Thiago

  • How can i set the values to text box by selecting from drop down list.

    hi ,
    i am using struts and jsps. i have a dropdown list of names(getting the values of names from database), i want to get address and phone number of that selected one.how can i get that?

    Hi swarupa,
    Well My advice in this senario wud Be
    Either U can make Use of XmlHttp Object through javascript(AJAX way).
    Or U need to Maintain the State of the entire form and then refresh the page to get those results....
    just for U r reference i am attaching a link which was programmed using ASP @ server side and which made use of XmlHttp Object.....
    http://www.w3schools.com/ajax/ajax_database.asp
    Just try to simulate the samething in your own way....
    REGARDS,
    RAHUL

  • How can we set default value within html:file

    Hai,
    To set default value to text box i use the following code. It works well.
    <html:text property="modifyserverdesc" value="<%= serverDesc%>" styleClass="text" size="38"/>But for file i use the code
    <html:file styleClass="file" property="modifyserverimgfile" value="<%= serverImage%>" size="40"/>It doesn't display value. What is problem here?

    Hi,
    guess that one option in a RowImpl would be to check if the attribute is null or if the attribute value can be found in the VO that populates the list. If first is true or seconds false (cannot be found) you return the first value of the VO, making it the current attribute value
    Frank

  • How can i compare the values of the objects in a class?

    hi ,
    i am testing how to test the values of the two objects
    this is the code i have return below.....
    class Sample{
              String name;
              int age;
              Sample(String name,int age){
                   this.name=name;
                   this.age=age;
    public class sample2{
              public static void main (String []arg){
                   Sample one = new Sample("cat",20);
                   Sample two = new Sample("cat",20);
    how can i test that object one and two are equal.
    can anyone clarify me about this?

    hansbig wrote:
    Um, this part doesn't work, it will never return true.
      public boolean equals(Object obj) {
    if (obj == this) {
    return true;
    It will :) try for example objectOne.equals(objectOne); and add a System.out.println() at that part. It will return there.
    >
    but this part, woah dude, that's some pretty slick code you got here:
    I couldn't figure out how to do the compare inside the class, but I think I see how this works.
    Not sure how I would do it for an object with more than one value to check though.
        if (obj instanceof EqualsExample) {               //Not the best implementation considering possible subclasses but the easiest.
    EqualsExample temp = (EqualsExample) obj;
    return (this.name.equals(temp.name)); //Always use the equals function when comparing strings!
    } else {
    return false;
    You could add them in one massive return (this.something == temp.something && etc). Or you could split it in a series of if statements. It's really dependant on what kind of variables there are in your class.
    Maybe you have an ArrayList you need to compare but also an id. then it would make more sense to check the id first and then possibly loop through the arraylist.
    Hope it's a bit more clear :)
    Edited by: hms on Jan 16, 2008 11:25 AM

  • How can I dynamically pass values to the DayOfWeek array given below?

    I have this below code:
    var onMondayAndTuesday = DailyTimeIntervalScheduleBuilder.Create()
    .OnDaysOfTheWeek(new DayOfWeek[] { DayOfWeek.Monday, DayOfWeek.Tuesday });
    var trigger = TriggerBuilder.Create()
    .StartAt(DateBuilder.DateOf(StartHour, StartMinute, StartSeconds, StartDate, StartMonth, StartYear))
    .WithSchedule(onMondayAndTuesday)
    .WithCalendarIntervalSchedule(x => x.WithIntervalInWeeks(Int32.Parse(nWeekInterval)))
    .EndAt(DateBuilder.DateOf(0, 0, 0, EndDay, EndMonth, EndYear))
    .WithIdentity(triggerKey)
    .Build();
    Here depending on the days users have selected any weekday would be passed in to the DaysOfWeek array. It might be just monday or monday
    and friday etc. How can I achieve this? Please advice.
    mayooran99

    Try this:
    DayOfWeek[] days = new DayOfWeek[7];
    days[0] = DayOfWeek.Friday;
    days[1] = DayOfWeek.Monday;
    days[2] = DayOfWeek.Saturday;
    var onMondayAndTuesday = DailyTimeIntervalScheduleBuilder.Create()
    .OnDaysOfTheWeek(days);
    also you can use it as a list:
    List<DayOfWeek> d = new List<DayOfWeek>();
    d.Add(DayOfWeek.Friday);
    Fouad Roumieh

  • How can I set default value in a field based on a LOV?

    Here's the LOV:
    select txtName, ID
    from FAC_LK_PROJECT_PRIORITY
    order by 1
    I tried:
    select id from FAC_LK_PROJECT_PRIORITY priority where txtname = 'Medium';
    and set the default value type to be PL/SQL function body but that didn't work - I get this error:
    ORA-06550: line 2, column 1: PLS-00428: an INTO clause is expected in this SELECT statement
    Error ERR-9131 Error in PLSQL function body for item default code, item=P19_PRIORITYID
    OK
    The item is a select list w/ db column as source: PRIORITYID

    Hi Scott. thanks for answering. I get from your post that I need to declare a variable and then return something. I changed it to this
    declare v_id number := null;
    begin
      select id into v_id
          from FAC_LK_PROJECT_PRIORITY priority
          where txtname = 'Medium';
      return v_id;
    end;and it works.
    Why do you use a loop? In case there's >1 row returned by the query?

  • How can I set range value in number in sql server

    Hello,
    I am using sql server 2012. I  want to display range value in int column. Suppose I have a table which contains
     columns called ID and dueDays. In dueDays there is data from 1 to 255 and slab range is 
    [7,15,30,60,150,250].
    Now I want to display range as per duedays, suppose from 1 to 7 , it should display 7.
    1-7   =
     7
    8-15  = 
    15
    16-60  = 60
    61-150  =150
    151-   151-250  =250
    >250 = >250
    Here is code snippet for create table and insert record.
    Create Table Tmp
    ID int ,
    DueDays int
    GO
    DECLARE @I INT = 1
    WHILE @I <=255
    BEGIN
    INSERT INTO TMP VALUES (@I,@I)
    SET @I=@I +1
    END
    Please also see attached image of required result.
    Prem Shah

    hello Jingyan,
    Thanks for reply but it doen't work in all case suppose range value is not exists in tmp then it is not working.
    delete following record and check expected result is wrong .
    delete from tmp where id in (3,7,15,30,60,150,250)
    Prem Shah
    Here is updated version:
    Create Table Tmp ( ID int , DueDays int)
    GO
    DECLARE @I INT = 1
    WHILE @I <=255
    BEGIN
    INSERT INTO TMP VALUES (@I,@I)
    SET @I=@I +1
    END
    delete from tmp where id in (3,7,15,30,60,150,250)
    --select * From Tmp
    declare @range varchar(100)='3,7,15,30,60,150,250'
    ;with mySplit as (
    SELECT distinct S.a.value('.', 'VARCHAR(100)') AS splitVal
    FROM
    (SELECT CAST (N'<H><r>' + REPLACE(@range, ',', '</r><r>')+ '</r></H>' AS XML) AS [vals] ) d
    CROSS APPLY d.[vals].nodes('/H/r') S(a)
    ,mycte as (
    SELECT a.id, iSNULL(a.id,splitVal) id2, splitVal FROM tmp a
    full outer JOIN mySplit as s ON Cast(splitVal as int)=a.DueDays)
    --select * from mycte
    Select id, ISNULL(rng ,255) rangeValues from mycte m
    outer APPLY (SELECT TOP 1 splitVal FROM mycte
    WHERE id2 >= m.id2 AND splitVal IS NOT NULL
    ORDER BY id2 ) d( rng)
    WHERE id is not null
    Order by id
    drop table tmp

  • How can i set some values to adf table(non bound to database)?

    hi
    i want to display some datas to an empty adf table on click of a button?
    My jdev version is 11.1.2.2
    Thanxxx

    There are a couple of ways of displaying data in an adf table if its not bound to a database.
    1. You can create a programmatic view object and populate it at run time(i.e. click of a button) and display the view object as a table.
    2. You can create a list of POJO objects and populate your adf table programmatically.
    By the way from where are you getting the data. Can you explain your use case a little more?
    Hope it helps.
    Umesh

  • Setting dynamic values to entity object

    Is there any way to set bean values (dynamic values) to Entity Object while commit the record, and how can i set these values using Groovy language
    Thanks in advance

    You need to give more information about the version of Jdev you use and your use case. read more -
    https://forums.oracle.com/forums/ann.jspa?annID=56

Maybe you are looking for

  • How do I remove "Adobe Flash Install Manager" malware

    This morning when I started the Macbook Pro 13", OSX 10.9.5, a pop-up box came up asking me to enter my system password for the "completer" to make changes. I cancelled the box without giving my password. In the Apple support community for OSX 10.7 g

  • LibreOffice 4.2.2 (and 4.1.5) help doesn't show various images

    Have upgraded to the libreoffice-xxxx-4.2.2-1-x86_64 packages, and found that various images in Help are missing, showing just a box with the text 'vnd.sun.st' (or is it 'wnd.sun.st' - poor definition) within. For example, look in the Index for Forma

  • Image re-sizing issue!

    Why can't I fix the size of my image in Photoshop? I try to make it, for example, 3.5" x 2.5", and have tried both the image size AND canvas size options. When I go and check the image size, it is 3.52" x 2.51", for instance. I've never encountered t

  • Merging Iphoto Libraries

    I'm using iphoto 08 and I recently imported and edited a number of photos on my laptop while on vacation. Now that I'm home, I want to import them to my home computer, keeping the edits etc. I tried burning to DVD and importing but the edited version

  • Programme works on Windows hangs on Sun Solaris(8) 5.8

    The programme works fine on Windows but hangs on Solaris 8(5.8). The programme hangs after processing of files is done . Yes my programme has Synchronization and threading. The code waits on a method. engine.GetName().equalsIgnoreCase(name) the GetNa