Problem with transmission of the data in table between a driver and a method.

I'm having a problem with a project for school. We want to take the data in a table, we create in our driver, pass it to the method, do something for her and return the data to the driver. Well, I still get the same error message and after looking at dozens of sites, it seems that I think that I have the correct code... but I still get the same error message. Here is the error message that I've been doing.
* ola1driver.java:35: get() in ola1method may apply to (char [] [])
x.get (Dar);
(upwards arrow pointing between x and get) *.

I'd appreciate any help I'm leaving research to simply looking at my code to try to find the error. My wife things I'm going nuts at the moment.

Here are my two files, the first is the driver and the second method

Take a 2D array and send the data to a method, and then put it back
import java.util.Scanner;
class ola1driver
{
Public Shared Sub main (string args [])
{
Entrance to the parser = new Scanner (System.in);
ola1method x = new ola1method();
Char [] [] dar = new char [10] [100];
char dat_input;

Set up the loop at the entrance a table of 10 x 100 with data imported from a dat file
for (int i = 0; i < 10; i ++)
{
for (int j = 0; j < 100; j ++)
{
dat_input = input.next () .charAt (0);
Dar [i] [j] = dat_input;
}
}
Send the array to the method and displays the original table to compare the return data
x.Set (Dar);
for (ip int = 0; ip < 10; ip ++)
{
for (int jp = 0; jp jp; < 100 ++)
{
System.out.printf ("%n", dar [ip] [jp]);
}
}

To get the data of the method and then print the data in the table opposite
x.get (Dar);

for (int r = 0; r < 10; r ++)
{
for (int c = 0; c < 100; c ++)
{
System.out.printf ("%n", dar [r] [c]);
}
}
}
}

Now the method;

Method to receive a 2D painting, reverse the data and then put it back
class ola1method
{
Char [] [] ar = new char [10] [100];
Char [] [] rar = new char [10] [100];

public void set (char [] [] ar)
{
/ * To reverse the entries in the table
to prove that real return
data was transferred between the driver
and the method * /
IR int = 0;
for (int i = 9; I have > 0; i-)
{
for (int j = 100; j > 0; j-)
{
int jr = 0;
RAR [ir] [Jr.] is ar [i] [j];.
Jr ++;
}

IR ++;
}
}
Return the data to the driver
public char [] [] get()
{
return of rar;
}
}

Published by: Seamus on February 20, 2011 08:25

Published by: Seamus on February 20, 2011 08:26

Seamus wrote:
I thought that I sent my method by using the x.set table, and then by calling the reversed with the x.get table.

x.Set (someArray) in fact to 'send an array to the method '.

And if x.get () is declared to return an array, then, Yes, it indeed 'retrieve a table. "

However, these are two completely different methods. The get method doesn't know something on the table sent via the set method unless the game puts a place who knows himself. For example, something like this:

public class X {
  private int[] arr;

  public void set(int[] arr) {
    this.arr = arr;
  }

  public int[] get() {
    reverse arr and return it
  }
}

public class Main {
  public static void main(String[] args) {
    int[] arr1 = {1, 2, 3};
    X x = new X();
    x.set(arr);
    int[] arr2 = x.get();
  }
}

However, this seems a bit unusual. It is not clear from your initial post, but looks like it is supposed to be a single method that takes the array and it reverses. If so, you could either simply invert the table and returns nothing, since the variable of the appellant and the parameter of the method will all be pointing to the same table object, or you could return a reference to the table that you have received and reversed, or you can copy the table, reverse the copy and return a reference to that.

I don't know what your needs are, but the point is that it is more common to call a single method to do something like that, rather than separate set() and get() methods.

Edited by: jverd February 20, 2011 09:36

Edited by: jverd February 20, 2011 09:37

Tags: Java

Similar Questions

  • Problem of transmission of the data of the object of the table via an IF statement

    I have problems with a data member of an object passing a table via an IF statement.  In my function, if I just display the type of an object selected in the list, it will return trip or Fill-Up on the screen, which is correct.

    If I use an IF statement to check the type first to see if it matches a string, it always by default the first game.  Suite of the code below, "it is a journey" always gets selected, even if the type matches "fill."

    What I am doing wrong?

    public void showEntry(e:ListEvent):void {}

    clearWindow();

    drawManageWindow();

    If (e.data.type = "Trip")

    {

    clearWindow();

    drawManageWindow();

    var showtype:Label = newLabel();

    ShowType.Text =

    "Show trip."

    ShowType.x = 500;

    ShowType.y = 40;

    ShowType.Height = 30;

    ShowType.Width = 485;

    addChild (showtype);

    }

    else if (e.data.type = "gas Fill-Up")

    {

    clearWindow();

    drawManageWindow();

    var showtype:Label = newLabel();

    ShowType.Text =

    "Show the Fill-Up."

    ShowType.x = 500;

    ShowType.y = 40;

    ShowType.Height = 30;

    ShowType.Width = 485;

    addChild (showtype);

    }

    }

    I'm surprised that the compiler is run, did disable strict mode?

    For compare equality using ==

  • problems with IE7 in the use of tables and onLoad

    Thank you in advance for any help. I have a table that is used to store the names of. Files to load into another SWF. SWF video. When I call the "onLoad" method, it works in all browsers except IE7? See the example below:

    prod_a = new Array;
    prod_a [0] = 12; number of products in the table. Currently, this feature is not used...
    prod_a [1] = "product1.swf";
    prod_a [2] = "product2.swf";
    prod_a [3] = "product3.swf";
    prod_a [4] = "product4.swf";
    prod_a [5] = "product5.swf";

    onLoad = Function)
    {
    Description();
    moveScroller();
    loader_mc.loadMovie(prod_a[1]);
    }

    When the file opens, it loads the '2' slot flash file in the table in the "loader_mc" EXCEPT IT DO WORKS NOT IN IE 7? any ideas or help would be great! IE7 handles the different "onLoad"? I made a mistake?

    Thank you Sly one, but that's not the problem I currentl having a Java work around for this. I tried a few different solutions to the problem "click to activate". I found that none of them made a difference.

    I resorted to a solution of 'disorder' but effective. -items I've been hainvg problems with were dynamically loading the text and images. I had the problem by placing the images and the text which was to load 'onLoad', in the boxes as _mc objects. in this way the images were already there and didn't need to be loaded.

    The only two problems with this is
    (A) Firefox and Safari users (including other) screen "Refresh" the image loading. and
    (B) the size of the file was more than 35 KB.

    Thanks for the help everyone, the final is good enough for Government work...
    -DIG

  • Unique problem with selction on the table (Query Page)

    Unique problem with selction on the table (Query Page)

    I have a VO data Bulletin Board, with a transitional attribute for selction unique column.
    My requirement is that I need to identify the line that was selected in the table.

    I associated with fireAction singleSelection column, such that whenever the user selects the line
    I'm looking for that VO using some rowIterator.
    But when running the loop of the transient VO that is mapped to the singleSelection variable is the show as "n" / NUll
    for all the lines...

    So how do you identify the selected line in singleSelection to a table.

    -Sasi

    In the property inspector of the element for which you've put firePartialAction, you can find a property named "parameters". That mention primary key as your setting.

    You can get the arameter using pageContext.getparameter ();

    -Anand

  • DataModeler: import of the data dictionary table comments

    Hi, I begin barely using SQL DataModeler and seems to have a problem with regard to the comments of reverse engineering table.

    When you use Import > data dictionary, I have no trouble importing column comments, but the comment table always seem to come up empty. I see no obvious option for y understood/off table/column comments so am puzzled as to why column comments import very well but the comments in the table are not (Yes, the tables, I'm importing have comments on the tables and columns).

    What Miss me? Any help is appreciated.

    -Andy.

    Hi Andy,.

    There is no option for this. They should be included, but unfortunately there is a bug and not included.

    Philippe

  • I have an older version of Firefox 3.6.6 I think I'm having a problem with one of the websites that I sign. Is it possible to upgrade to the latest version

    I have an older version of Firefox 3.6.6 I think I'm having a problem with one of the websites that I sign. Is it possible to upgrade to the latest version. Without losing all my favorites and the saved passwords?

    Yes, see this article:

    After:

  • Problem with Vista hit the Satellite X 200 - 20 s

    Sometimes during typing on vista, it will stutter and freeze. The time is very short. Is this a problem with vista or the laptop. The T7300 Core 2 Duo 2 ghz processor.

    Hello

    I have a Satellite Pro S200 and the same problem was with my camera. It s is not a hardware problem, it s more a driver related issue No. So, the best thing you can do is update your bios and keep your drivers up-to-date. Just check the download Drivers Toshiba site and make sure you have the latest drivers installed.

    I had resolved my stuttering (core2duo 2.33 Ghz, 2 GB RAM) by updating all drivers...

    That's all

    Good bye

  • I have a problem with access to the C drive.

    Original title: lost access to the C: drive...

    When I was a noob after installing a new HARD drive, I have written an autorun.inf file to my C: drive to make it look cool (you know, give it a cool name, and change the icon). I was not allowed to save .inf in the root files, so I decided to open the properties and tinkering with security... when I turned on my computer later, I now do not have access to the c drive, and cannot do anything administrative (including rear safety switching)

    Please, please help!

    Hello

    Method 1:

    You can enable integrated admin and restore the system.

    Step 1:

    To activate the built-in Administrator account, follow these steps:

    a.Click theStart button, then type cmd in the Search box.
    In the list of research results, right click on cmdand then click run as administrator.

    b.At the command prompt, typenet user administrator / Active: Yesand then press ENTER.

    net user administrator , c.Type and then press ENTER.
    Note: Please replace the tag with passwords which you want to set for the administrator account.

    Type exitand press ENTER. Disconnect from the current user account.

    Step 2:

    System restore

    http://Windows.Microsoft.com/en-in/Windows7/products/features/system-restore

    Method 2:

    If the problem persists, perform a repair installation (upgrade on the spot).

    Check out the following link to do the same thing:
    http://support.Microsoft.com/kb/2255099

    Note:
    You can back up data to an external hard drive and no CD. It is essential to back up data even if you do an upgrade on the spot.

    Reference:

    Back up your files

    http://Windows.Microsoft.com/en-us/Windows7/back-up-your-files

    It will be useful.

  • Get the data in table of javafx

    Bat I can get the data in table as:

    [code]

    for (int i = 0; i < dtm.getRowCount (); i ++)

    {

    for (int j = 0; j < dtm.getColumnCount (); j ++)

    dtm.getValueAt (i, j);

    [/ code]

    But how can I do this with javafx table? I google and google and google and no luck.

    In JavaFX make data are stored on a basis per line. Each line contains an element of type T (where you have a TableView), and each column specifies a value using a callback function that determines the value of the column of the value of a particular line.

    You can browse the data simply by practice

    for (T item : table.getItems()) {
      // ...
    }
    

    And then get the value of each column for each element of the given line, since you "know" what each column represents.

    For example, in the example of JavaFX documentation, you could do:

    for (Person person : table.getItems()) {
      String firstName = person.getFirstName(); // value in firstName column
      String lastName = person.getLastName(); // value in lastName column
      String email = person.getEmail(); // value in email column
    }
    

    If you want something really generic, you can try

    for (T item : table.getItems()) {
      for (TableColumn col : table.getColumns()) {
        Callback, ObservableValue> cellValueFactory = col.getCellValueFactory();
        CellDataFeatures cdf = new CellDataFeatures(table, col, item);
        Object cellValue = cellValueFactory.call(cdf).get();
        // do something with cellValue...
      }
    }
    

    If you have little chance to this need, unless you write some kind of framework. (I just typed it here, you may have get dirty you with guys a little to make things).

  • Problem with script on the master page

    So I have my build script of the unique number bit that I have posted here before... it's on the Initialize event of the field.


    If (this.rawValue == null) {}
    var d = new Date();
    this.rawValue = parseInt(d / 1000);
    }
    else {}
    this.rawValue = rawValue;
    }

    Which works very well if on the body of the form, but if I put it on the master page it re - initializes (and changes the number) whenever a subform gets shown/hidden. No idea how to stop it from doing this? I tried it on a few other events without a bit of luck.

    I came across another problem with this script, a field called 'Date' was interfering with the script - throw an error "the Date is not a constructor. Is - this normal (function/field collision)?

    Hi Jono,

    I had problems with script within the Master pages before. What I've done in the past, it is a textfield hidden in the main pages of script with overall binding (which featured many here today); then same name textfield in the master page picks it up.

    Good luck

    N.

    Post edited by: Niall O'Donovan

  • Numbers with comma in the data Cube Viewer

    Hello

    I want to know what to do to display numbers with comma in the data Cube Viewer. The data type of the measure in the cube is NUMBER (4.3). The default aggregation is AVERAGE. When I load the cube with the numbers of the exactly NUMBER format (4.3) - in the data Cube Viewer I see only rounded integer values without decimal point.


    If I load the test instead of cube table - the numbers are loaded in the correct format.


    What should I do to load the cube with point numbers? Is this possible in OWB?

    Now, I decided to use a way to go around it - simply put 1453 instead of 1.453. Then it works (but this isn't a great solution). It is the only way?

    Thanks in advance for any help

    Peter

    Hi Peter

    The cube data viewer has a toolbar with a lot of options... formatting, you can add and remove the numbers after the decimal point. From memory, I think you have to select the cells you want, you can click and select all the cells in the table and then use the button Add digits after the decimal point.

    See you soon
    David

  • problem with checkbox on the tabular form

    (All my friends at the time of deperate) Hi,

    I have a tabular form on a page, which I use for adding record only. So it always shows me a blank line, which is ready to be inserted after the user has filled in the data and click on the "submit" button.

    Now, I have a field check box on this form of table. Since all the columns that I show as null, I also shows this check box cleared when page appears. This is the query for the region of origin of this form:

    SELECT "Customer", null
    NULL "currency."
    HTMLDB_ITEM. CheckBox(40,'YES',null) critical_box,
    OF the double

    I used the 'YES' as return value of this checkbox (when the user checked, otherwise I guess that's not equal to 'YES').

    I have my own update process, which gets triggered when clicking on 'submit '.
    It's my insert clause in this update process:
    INSERT INTO table1
    (customer, currency, critical_level)
    values
    (APEX_APPLICATION.g_f01 (i), APEX_APPLICATION.g_f02 (i), decode (APEX_APPLICATION.g_f40 (i), 'YES', 'YES', 'NO')


    Now the problem is that when I click on checkbox and save it, it adds record correctly. But when I click on check box when you insert, I get error message no data available. It must insert 'NO' for the 3rd column when the check box is not clicked.

    Please help here. Not sure why its not giving no data found error when unchecked the checkbox on the form of tables.

    Thank you and best regards,
    Rave.

    Sorry, this one is out of date, try this

    http://HTMLDB.Oracle.com/pls/OTN/f?p=31517:219

    Here are a few related threads you might be interested.

    Re: Boxes to check off and go to the other fields in the table
    Re: Problem in selecting the checkbox values
    Tabular presentation - box

  • Having a problem with loading in the combustion chamber

    Hello

    I'm having a small problem I could use help with. I'm not really sure what's going on, but I'm having a problem with one of the pages of my site does not when you try to view the page in Firefox. But if I loaded this page in Safari or Chrome, it loads very well.

    Here is the URL of the page to take a look:
    Specific link removed by moderator display ~ J99 < sitename >.com/top-10/top...services/

    No idea why this might be happening or how to fix it? I don't know if it's just my computer, or if others have the same problem.

    Thanks in advance,

    Mike

    There's two of us have confirmed the page will load so I deleted the link to display as it could be construed as advertising.

    P.S. Note only forum content in the resolved threads is now indexed by search engines.

    (Last updated: February 14, 2015 08:45 CEST)

    Solved the locked thread now ~ J99

  • Using an IP191 monitor, have random horizontal stripes on the screen - have no problems with other browsers. also no problem with FF on the other PCs on the family

    Using an IP191 monitor, have random horizontal stripes on the screen - have no problems with other browsers. also no problem with FF on the other PCs on the family.

    These "streaks" seem to be the domain of the high frequency analysis; they can be eliminated by scrolling upwards or downwards.

    Hello, maybe it's a problem with hardware acceleration - try updating your graphic driver, or in case this does not solve the problem, or there is no new version available at the time, disable hardware acceleration in the firefox menu

    > options > advanced > General.

  • I want to download free applications, but it doesn't let me do it cause I have a problem with my payment, I try to remove my debit card and the option did not appear, I can't choose no for the payment, what can I do?

    I want to download free applications, but it doesn't let me do it cause I have a problem with my payment, I try to remove my debit card and the option did not appear, I can't choose no for the payment, what can I do? This happen after I bought some coins for a game

    You must settle the debt until you can download something else of the podcast episodes on the iTunes Store or select None as the payment option.

    (142394)

Maybe you are looking for

  • No sound in Windows 10 in BootCamp.

    I did a clean install of Windows 10 in training camp with the ISO (International English) I downloaded from Microsoft. There is no sound on the Windows side, but it seems to work fine otherwise. In the Windows Device Manager shows no driver problem.

  • IntelMacPro Mid2010 [MacPro5, 1 (Mac-F221BEC8)] kern_exec.c:4067

    Hello! Mac gurus: I had an IntelMacPro Mid2010 [MacPro5, 1 (Mac-F221BEC8)]. OSX 10.10.3. Close and try to restart. A gray screen pops up: your Mac has encountered a problem. Wait a minute and press any key to restart. I hit the 'Enter' key and, 30 se

  • Analog input voltage assistant DAQ

    Does anyone know why theres error when you use two assistant DAQ (in a while loop at the same time) for reading of the analog input voltage? There is not a problem if you use a wizard to data acquisition for analog input voltage reading simple.

  • How can I open osk.exe in my c# windows on the click event of button application

    I tried the following code, but its still does not using System.Diagnostics; private void button17_Click (object sender, EventArgs e) { System.Diagnostics.Process.Start ("osk"); Process.Start(@"C:\windows\system32\osk.exe"); } but it's not always wor

  • faster data transfer on ethernet

    Hi friends, I use VISA for instrument control via ethernet tcp/ip Protocol.the application is written in VB6 with the help of measurment studio controls I need to read the data of the large array, element by element, since the insrument has no transf