How do i view an array which is in another class?

I know how to view variables from another class but i dont know how to view arrays from another class. Im trying to get my class to view data from the other class's arrays. Can it be done in Java? If it can, then how?
These are my arrays, i want these to be viewable by the other class:
    public int arraySmallWhiteStars[][] = new int [600][3];
    public int arrayLargeWhiteStars[][] = new int [3][3];
    public int arrayYellowStars[][] = new int [3][3];
    public int arrayMars[][] = new int [1][3];How can i do it?
Ant...

what, so i would do it like this:
pnlDraw.drawShip(arrayOne[][]);i dont think that will work!
are you sure?
Ant...Are these instance variable or local variables? What I'm saying is. are these arrays declared in the drawShip method?
and passing parameters to a method is NOT how you gets public variables from a class. Are you sure you know how to do that?
If I have a class with a public instance variable called, say int[] myInt I can access values of that via.
int fromOtherClass = myClassInstance.myInt[0];

Similar Messages

  • How to access an attribute(this is referencing to another class) in a class

    Dear Gurus,
    I have to read an attribute of a class and that attributes type another class.
    I have intantiated the class and my question is how to read the attribute. I know I can not dirrectly read the attribute since this is another class. I think I have to first reference the attribute right? Please advise me.
    My code looks like below:
    data: lo_fpm                                 type ref to if_fpm.
    data: lo_msg_mgr                        type ref to if_fpm_message_manager.
    data: lo_component_manager    type ref to cl_fpm_component_manager.
    lo_fpm = cl_fpm_factory=>get_instance( ).    " cl_fpm_factory is a class which has a static method get_instance
    lo_msg_mgr = lo_fpm->mo_message_manager.
    lo_component_manager = lo_fpm->mo_component_manager.
    The above statement is giving syntax error. I do not know why.
    The basic difference b/n the two methods is if_fpm~mo_message_manager    type ref to if_fpm_message_manager    and
    mo_component_manager     type ref to cl_fpm_component_manager.
    Any help would be appreciated.
    Thanks,
    GSM

    Hello
    I cannot test the following coding because I do not get the singleton instance yet it should work:
    *& Report  ZUS_SDN_CL_FPM_FACTORY
    *& Thread: How to access an attribute(this is referencing to another class) in a class
    *& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1398429"></a>
    REPORT  zus_sdn_cl_fpm_factory.
    DATA: go_fpm TYPE REF TO cl_fpm.  " class implements if_fpm.
    DATA: go_msg_mgr TYPE REF TO if_fpm_message_manager.
    DATA: go_component_manager TYPE REF TO cl_fpm_component_manager.
    START-OF-SELECTION.
      BREAK-POINT.
      go_fpm ?= cl_fpm_factory=>get_instance( ). " cl_fpm_factory is a class which has a static method get_instance
      CHECK ( go_fpm IS BOUND ).
      go_msg_mgr           = go_fpm->mo_message_manager.
      go_component_manager = go_fpm->mo_component_manager.
    END-OF-SELECTION.
    Regards
      Uwe

  • How can I consume a transaction which is on another SAP server or client?

    Hi.
    I work on SAP Collateral Managements (SAP CMS), on the transaction (cms_wb), this transaction works to create Collateral Objects, on some collateral objects need to do reference some number of document. The documents which i need to reference on the object. If this documents don't exist, are need to create on SAP FI (SAP FI is in other server).
    On the transaction(cms_wb) I create the document, if it doesn't exist. I only click an icon, and then this icon opens the transaction of SAP FI. 
    This configuration was done by SAP Basis Consultant.
    Do you have any idea to do this on ABAP program?

    Debug the button click and you'll see how it works... it all comes down to ABAP code no matter who implements it .

  • How do i view websites visited parental controls on another computer

    I set up parental controls on the computer and it said I was able to view what the child was looking at by another computer and I'm not sure how to do that.

    slyfox4 wrote:
    Is there anyway to be able to open both of my iPhoto libraries that are backed up on my hard drive with both my computers?
    You can't open them with iPhoto but you can view and restore individual photos in the backups.  See the gray box towards the end of Time Machine - Frequently Asked Question #15.

  • How can I view backed up iPhoto images from another computer?

    Hi! I have an iMac, and a MacBook Pro. I have backed up both my iMac and MBP to a Seagate FreeAgent 1 TB external hard drive. I am going abroad, and I want to delete my photos from my MBP. Before I do that I want to be sure that I can still be able to view them on MBP while I am away instead of keeping them on my computer. So, I went into my iMac backup on my MBP and I tried to open my iPhoto Library, but I received this message... "The iPhoto library is a Time Machine backup, and so cannot be used as the main library. Reopen iPhoto with the Option key held down to choose another library."
    Is there anyway to be able to open both of my iPhoto libraries that are backed up on my hard drive with both my computers? Or can I only view the images on the computer they were originally on? Because in that case then I can't delete the photos from my MBP like I had planned.
    Thank you!!!

    slyfox4 wrote:
    Is there anyway to be able to open both of my iPhoto libraries that are backed up on my hard drive with both my computers?
    You can't open them with iPhoto but you can view and restore individual photos in the backups.  See the gray box towards the end of Time Machine - Frequently Asked Question #15.

  • How to run a listener which is in another class??

    I want to call any listener from class a to b.
    For example in ClassA there exsist a button a.
    And in ClassB there exsist a button b.
    When I use the button A, I want to change the Button B's name.
    How can I do this?

    Thanks for all! It is ok.
    This is what I did in separate classes:
    A.java
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class A extends JPanel{
         public A(){
              a= new JButton("AAA");          
              add(a);          
         public JButton a;
    B.java
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class B extends JPanel{
         public B(){          
              b= new JButton("BBB");          
              add(b);          
         public JButton b;
    C.java
    import javax.swing.JButton;
    import javax.swing.JPanel;
    public class C extends JPanel{
         public C(){          
              c= new JButton("CCC");          
              add(c);          
         public JButton c;
    JFrameABC.java
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JFrame;
    public class JFrameABC extends JFrame implements Runnable{
         public void run(){
              final A a = new A();
            final B b = new B();
            final C c = new C();
            a.a.addActionListener(new ActionListener(){
                public void actionPerformed(ActionEvent evt) {
                    b.b.setText("newB");
            b.b.addActionListener(new ActionListener(){
                 public void actionPerformed(ActionEvent evt) {
                      c.c.setText("newC");
            c.c.addActionListener(new ActionListener(){
                 public void actionPerformed(ActionEvent evt) {
                      a.a.setText("newA");
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            getContentPane().add(a, BorderLayout.NORTH);
            getContentPane().add(b, BorderLayout.CENTER);
            getContentPane().add(c, BorderLayout.SOUTH);
            pack();
            setLocationRelativeTo(null);
            setVisible(true);
    RunJFrameABC.java
    import java.awt.EventQueue;
    public class RunJFrameABC {
        public static void main(String[] args) {
            EventQueue.invokeLater(new JFrameABC());
    }---------------------------------------------------------

  • How transfer license from 1 computer, which died, to another computer?

    The laptop computer which had LabView install died, so there is have no way of removing the license on that particular computer. Is there any way to release that license and install it onto a new computer? Thank you

    Contact NI with the license number and ask if they can deactivate it from the computer.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • How can I view the Firefox Reading List?

    I am running Firefox on Android 2.3.4. I am reading about the Firefox "Reader Mode" [1], which states:
    "By tapping the readinglist1 icon, you can add the current page to your reading list (a special folder in your bookmarks list)"
    "Note: The reading list folder will not be shown until the first item is added to the list. If all the items in the list are removed, the reading list will be hidden again."
    Once I add the current page to my reading list, the screen changes and I am presented with different navigation controls. From here, the documentation says that:
    "By tapping the readinglist2 icon, you can display the reading list. "
    I have several items in my Reading List. However, I can only see the 'readinglist2' icon when I am viewing a page which has been converted to the Reader Mode. If I browse my bookmarks I do not see a folder for the reading list.
    How can I view the items which I added to my "Reading List"?
    [1] https://support.mozilla.org/en-US/kb/how-enable-reader-mode-firefox-android?fpa=1

    You can open any chrome file in Firefox via the location bar, provided you know the path.<br />
    XML (XUL) files need a view-source: prefix.
    chrome://browser/skin/browser.css
    chrome://browser/content/browser.css
    resource:///defaults/pref/firefox.js
    resource:///greprefs.js

  • How can I view medical CDs with x-rays on them?

    How can I view CDs on which there are medical x-rays?

    You can use jackimaging.com
    If you insert your CD, drag and drop your files over to jackimaging.com/demo (using the Chrome browser). You can view your images instantly (and it's free).
    If you want to upload them, you can create a free account. Once your files are uploaded, you can share them as well.
    Here's a user guide: https://app.usedox.com/d/ccVKb/Jack-Imaging-How-To-Guide-pdf

  • I linux inode which contains 13 member array wich stores the actual block address of data .Similarly in windows how data is managed in disk ?. How many members in this array ?

    I linux inode which contains 13 member array wich stores the actual block address of data .Similarly in windows how data is managed in disk ?. How many members in this array ?

    Hello Vijay Nerkar,
    Your question is not related to Windows Forms General. What is the data you mean and also what is that array?
    If you are looking for something related to Windows File System, see some words here:
    http://en.wikipedia.org/wiki/File_system
    For example
    "Windows makes use of the
    FAT, NTFS,
    exFAT and ReFS file systems (the last of these is only supported and usable in
    Windows Server 2012; Windows cannot boot from it).
    Windows uses a drive letter abstraction at the user level to distinguish one disk or partition from another. For example, the
    path <tt>C:\WINDOWS</tt> represents a directory <tt>WINDOWS</tt> on the partition represented by the letter C. Drive C: is most commonly used for the primary hard disk partition, on which Windows is usually installed and from which it boots. This "tradition"
    has become so firmly ingrained that bugs exist in many applications which make assumptions that the drive that the operating system is installed on is C. The use of drive letters, and the tradition of using "C" as the drive letter for the primary hard disk
    partition, can be traced to
    MS-DOS, where the letters A and B were reserved for up to two floppy disk drives. This in turn derived from
    CP/M in the 1970s, and ultimately from IBM's
    CP/CMS of 1967.
    For more details, consider consult on MS Answers:
    http://answers.microsoft.com/en-us/windows
    Regards,
    Barry Wang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to pass an array which in the jsp to a javascript file

    now i have 2 files: jsp and js(javascript)
    i want pass an array which in the jsp to another file--> js file
    how can i do it ???
    can u give me some related links or some source codes as the references???
    thx

    bcos ....my senior has resigned!!! so i take over his job !!!!!
    depend on the talent and the project ....only that way to implement to whole project !!!!
    but , i had settled it already ....
    it is very simple
    in the middle.jsp
    Collection result = menuManager.getUserRoleMenu(webSessionUser.getGnuserId());
    String menuname[]=new String[110];
    int menucounter=0;
    Iterator vi = result.iterator();
    while(vi.hasNext())
    HashMap hm=(HashMap)vi.next();
    menuname[menucounter]=hm.toString();
    menucounter++;
    int i;
    String tempstr="";
    for(i=0;i<menuname.length;i++)
    tempstr+=menuname[i]+",";
    session.setAttribute("menuname",tempstr);
    %>
    <script language="javascript">
    menu123("<%=tempstr %>");
    </script>
    in the body,js
    function menu123(string123)
    //doing
    so ....through the script --menu123
    i can get the string from jsp to the js!!!!!
    is it very simple, but it spends my 2 days!!!
    i just learn javascript ....about 1 month !!!

  • How do you create a pdf which is in a readable view, rather than having to rotate the document?

    How do you create a pdf which is in a readable view, rather than having to rotate the document?

    This cannot be done with Adobe Reader. Do you have Adobe Acrobat?

  • How can I view photos I downloaded 2-3 years ago and which suddenly seem to have disappeared. Only photos taken within the past 12 months are visible.

    How can I view photos I downloaded 2-3 years ago and which suddenly seem to have disappeared. Only photos taken within the past 12 months are visible.

    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto. Version 8.1.2
    - What version of the Operating System. OSX 10.9.4
    - Details. As full a description of the problem as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    When I open iPhoto, only the most recent photos are shown (last 12 months)
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages? This has been going on for several weeks now. There are no error messages, but yes, I had an update in the system (QuarkXPress 10.1), and the problem has occurred from that day.
    - What steps have you tried already to solve the issue. I tried to find out where the problem came from, but found no solution.
    - Anything unusual about your set up? Or how you use iPhoto? No
    Anything else you can think of that might help someone understand the problem you have.
    Thank you so much for offering help. I am not a proficient user of the system.

  • How to return a array which be created in native method?

    i wrote my native method like this:
    jintarray array=env->Newintarray(10);
    jint* p=env->GetIntArrayElements(array,0);
    for(int i=0;i<10;i++){
    p=i;
    return array;
    the result is that i got a array which has ten elements and all the elements are 0.
    it seems the value of the array never be chenged.
    how can i do? where is the mistake? how can i get the correct result?

    Not quite clear what you are trying to do.
    o You create a java in array, which will be initialized to zeroes.
    o You then asked to access that array (as p), but you didn't pass a pointer to a boolean so it can tell you whether p points into the java array, or is a separate memory area.
    o You assigned a bunch of int values to p - not p[0], p [1], ....?
    o You returned to java the original array.
    Here's some (untested) code that will likely work:
    jBoolean isCopy;
    jintarray array=env->Newintarray(10);
    jint* p=env->GetIntArrayElements(array,&isCopy);
    for(int i=0;i<10;i++){
    p=i;
    if (isCopy == JNI_TRUE)
    env->ReleaseIntArrayElements(array, p, 0);
    return array;

  • I'm trying to purchase Guy Sebastian's (Australia) albums, but I keep getting a link "view in iTunes" which doesn't respond.  How can I purchase music that's a few years old?

    I'm trying to purchase Guy Sebastian's (Australia) albums:
    "Beautiful Life"
    "Closer To The Sun"
    "Just As I Am"
    "Twenty Ten"
    , but I keep getting a link "view in iTunes" which doesn't respond so I can purchase the items thru iTunes.
      How can I purchase music that's a few years old?

    Guy's older albums have been on other countries' Itunes in the past.  I don't know why they come and go.  Guy keeps promising to spend more time overseas, releasing and promoting his music.  I'm sure they'll all become available again then.  You could import CDs, of course, but that becomes expensive.  Online, Sanity and JBHiFi in Australia will mail overseas.

Maybe you are looking for