How do you call a java class from the main method in another class?

Hi all,
How do you call a java class from the main() method in another class? Assuming the two class are in the same package.
Thanks
SI
Edited by: okun on May 16, 2010 8:40 PM
Edited by: okun on May 16, 2010 8:41 PM
Edited by: okun on May 16, 2010 8:47 PM

georgemc wrote:
To answer your impending question, either the method you're calling has to be static, or you need an instance of that other class to invoke it against. Prefer the latterAnd to your impending question after that: no, don't use the Singleton pattern.

Similar Messages

  • How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed and you don't know what it is now?

    How do you access updates to apps from the App store after changing to a new ID because the password on the old ID was changed by the former husband and you don't know what it is now?  And you set up your own new ID and account but can NOT access the updates, from the App store for the many apps that you already have, because they require that you sign in with that former now inaccessible ID and account and password?  Call it a problem of modern times and changing relationships, if you want to be charitable.

    So I guess it will only be new apps that I download that are allowed to give me their updates while 13 updates wait for me on an ID I can no longer access.
    Yes...  sorry.
    In the future, if need be, you can re download your purchases for free  >  Downloading past purchases from the App Store, iBookstore, and iTunes Store
    Good rule of thumb is to back up your purchases regardless  >  Mac App Store: Backing up your app purchases

  • How do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full

    how do you remove back up data from the memory storage? my storage data states that i have over 80gb of data used for back ups and i dont know why as i use a external hard drive as a time machine .now my 250gb flash storage is nearly full.. HELP!

    When Time Machine backs up a portable Mac, some of the free space will be used to make local snapshots, which are backup copies of recently deleted files. The space occupied by local snapshots is reported as available by the Finder, and should be considered as such. In the Storage display of System Information, local snapshots are shown as  Backups. The snapshots are automatically deleted when they expire or when free space falls below a certain level. You ordinarily don't need to, and should not, delete local snapshots yourself. If you followed bad advice to disable local snapshots by running a shell command, you may have ended up with a lot of data in the Other category. Ask for instructions in that case.
    See this support article for some simple ways to free up storage space.

  • How do you move a quicktime movie from one iphoto library to another?

    How do you move a quicktime movie from one iphoto library to another?

    1 - export it from Library A via the File ➙ Export ➙ File Export menu with Kind = Original.
    2 - import it into Library B as you normally would.
    OT

  • How do you get old emails back from the cloud storage

    how do you get old emails back from the cloud storage

    How did you get them into cloud storage?

  • How do you edit photos with photoshop from the new  Photos app?  The edit in external editor menu item seems to be gone.

    How do you edit photos with photoshop from the new  Photos app?  The edit in external editor menu item seems to be gone.

    Tell Apple what additional features you want in Photos via both http://www.apple.com/feedback/macosx.html and http://www.apple.com/feedback/iphoto.html  since they don't have a feedback page for Photos as yet.

  • How do you remove old email addresses from the invitee drop down menu in Calendar

    How do you remove old email addresses from the invitee drop down menu in Calendar

    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Caches/com.apple.iCal/Previous Recipients.plist
    Right-click or control-click the line and select 
    Services ▹ Reveal
    from the contextual menu.* A folder should open with an item selected. Quit the application if it's running. Move the selected item to the Desktop, leaving the window open. Relaunch the application and test. If there's no change, quit again and put the item you moved back where it was, overwriting the one that may have been created in its place. Otherwise, delete the item you moved.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard (command-C). In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

  • How do you delete a VIP mailbox from the mail app?

    How do you delete a VIP mailbox from the mail app?

    From Mail help:
    Make a sender a VIP
    To keep track of messages you receive from especially important people, make them VIPs in Mail. You can have up to 100 VIPs.
    To make someone a VIP, move the pointer to the left of the sender’s name in the message header and click the star that appears. You can also move the pointer over the sender’s email address, click the arrow that appears, and choose “Add to VIPs” from the pop-up menu.A mailbox for the VIP is added to the Favorites bar. For example, if you make Dad a VIP sender, his messages are displayed in a VIP mailbox titled Dad.
    To remove VIP status from a sender, click the VIP’s star in a message. The star is removed and the sender’s VIP mailbox is removed from the Favorites bar.
    If a VIP has several email addresses in Contacts, messages from any of those addresses will appear in the VIP’s mailbox.
    If you use iCloud Contacts, your VIPs are available on your other Mac computers that use iCloud Contacts and have OS X Mountain Lion installed.
    So to remove a VIP mailbox, you would have to remove all its people, and then exit mail.

  • How do you recover a deleted playlist from the cloud?

    How do you recover a deleted playlist from the cloud?

    If you navigate to your Trash folder the message should be there ... if not then perhaps this is a setting on your particular account (the Exchange server side, not the iPhone). On my Exchange account for work I can go to the Trash folder and not only find a deleted message, but move it back to my Inbox (or any other folder).

  • How do you access your itunes library from the icloud on your ipad

    How do you access your itunes library from the icloud on your ipad?

    You have asked two different questions?
    Your account is just a user name and password.  You can access that to buy content from any computer with itunes, just sign it.
    Your library wil only be where your put it. Yo can copy it from one computer to another, or from your backup copy of your computer ot another computer. In some countries you can download some past itunes purchases.
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How to add a code TestIfElse(10) to the Main method of the Program.cs class?

    How to add a code  TestIfElse(10) to the Main method of the Program.cs class?
    Here is my code and I have copied from the Wiley book for Microsoft certification page 14,
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ifelse_Statement
        class Program
            static void Main(string[] args);
            TestIfElse(10);
            public static void TestIfElse(int n);
            if(n < 10)
                     Console.WriteLine("n is less than 10");
             else if(n < 20)
                    Console.WriteLine("n is less than 20");
             else if(n < 30)
                Console. WriteLine("n is greater than or equal to 30");
    Here is the error list I am getting,
    Error 1      Method must have a return type        C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 13
    switch_Statement
    Error 2
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 24
    switch_Statement
    Error 3
    Method must have a return type C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 9
    ifelse_Statement
    Error 4
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 20
    ifelse_Statement
    Error 5
    Invalid token 'if' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 9
    ifelse_Statement
    Error 6
    Invalid token '10' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 7
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 8
    Invalid token '(' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    18 35
    ifelse_Statement
    Error 9
    A namespace cannot directly contain members such as fields or methods
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    20 10
    ifelse_Statement
    Error 10
    Type or namespace definition, or end-of-file expected
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    30 1
    ifelse_Statement
    Error 11
    The type or namespace name 'n' could not be found (are you missing a using directive or an assembly reference?)
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    16 12
    ifelse_Statement
    Error 12
    'System.Console.WriteLine(string, params object[])' is a 'method' but is used like a 'type'
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    18 26
    ifelse_Statement

    static void Main(string[] args){
    TestIfElse(10);
    public static void TestIfElse(int n)
    if (n < 10)
    Console.WriteLine("n is less than 10");
    else if (n < 20)
    Console.WriteLine("n is less than 20");
    else if (n < 30)
    Console.WriteLine("n is greater than or equal to 30");
    Fouad Roumieh

  • HT1766 HOW CAN I CHANGE MY BACKUP FOLDER FROM THE C DRIVE TO ANOTHER?????

    HOW CAN I CHANGE MY BACKUP FOLDER FROM THE C DRIVE TO ANOTHER????? because my c drive in the windows computer gets filled and i need to back up my ipod to a portable hard disk.. bt i dont know how to do it.. plz help

    you can't change the backup folder as far as I know, but you can choose to move backups. The information you need can be found in this article: http://support.apple.com/kb/ht4946
    Where iTunes backups are stored on your computer
    The folder where your backup data are stored varies depending on the computer's operating system.   Make sure the backup folder is included in your periodic data-backup routine.
    iTunes places the backup files in the following places:
    Mac:  ~/Library/Application Support/MobileSync/Backup/
    Windows XP:  \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Note: To quickly access the Application Data folder, click Start, and choose Run. Type %appdata% and click OK.
    Windows Vista and Windows 7:  \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Note: To quickly access the AppData folder, click Start. In the search bar, type %appdata% and press the Return key.
    Hope this helps
    Regards,
    Stijn

  • Can we call main method in another class?

    Hi...
    can we call main method in another class?
    If no, please tell me the exact reason why can't we call that....

    ok
    can u give that code for me?
    class A {
    public static void main(String [] args){
    System.out.println("In A");
    class B {
    public static void main(String [] args){
    A.main(null);
    }

  • Invoking the main() method of a class within another

    Greetings -
    Can someone tell me what happens when you invoke the main() method of a class from within another class?
    I have a third-party class, designed to be invoked from a command line, that I want to invoke from within a separate class. What appears to be happening is that following the successful execution of the third-party class, the invoking class is terminated as well. That's not the intended behavior I had envisioned. ^_^
    Is there a better way than invoking the main() method? I still need the invoking class to continue executing.
    Thanks!

    Navigate yourself around pitfalls related to the Runtime.exec() method

  • How can I call a java object from Web dynpro ABAP application?

    I made Web dynpro ABAP application and posted it to SAP EP.
    For certain business purpose, we need to call external 3rd party java object using 3rd party's java api in Web dynpro application.
    Is there anybody who experienced this kind of java interface issue?
    I know Web dynpro Java environment can fully support this kind of requirement. but regarding Web dynpro ABAP, I couldn't find any clue for this.
    Any comment or suggestion would be greatly appreciated.
    Thanks,
    Raymond, ABAP Consultant

    if you have jco configured, then you can make calls to java api from ABAP .
    check out this weblog.
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    Raja

Maybe you are looking for

  • Creation of  diagram with the given data as input and to enable click event

    Is it possible to create an image from a dynamic input. For example if a relationship exists between A->B ,A->C ,A->D , B->E,B->F . Then the initial diagram should display a node leaf diagram with A as root and B,C,D as leaf. When u click on B again

  • How can I install iLife '09 on macbook pro?

    I have a new Macbook Pro, which I installed iMovie onto. I want to burn my movie onto a dvd, and do not have iDVD installed. I did purchase a Superdisk. Someone said I need to purchase an older version. I am stumped and frustrated. Please help....

  • Copy any kind of file from content server to network directory

    Helli All The question: I nee to copy any kind of file from content server to any network directory. Explanation 1. transaction CV02N 2. There is attached file for a document in tab "Document data/Original" 3. This file stored in content server 4. I

  • Can't download an file from AUR (using yauort)

    I keep getting the same error when I try to download anything using yaourt: [kaipee@kphmsrv ~]$ yaourt bittorrent-sync 1 aur/bittorrent-sync 20130510-1 (36) BitTorrent Sync ==> Enter n° of packages to be installed (ex: 1 2 3 or 1-3) ==> -------------

  • I can't purchased anything from the App store..... HELP ME

    I can't purchased anything from the App store, it keeps telling that there is a problem with the previous purchased and when I tried to re-enter the information , this message keep showing " your payment method was declined please use valid method" e