So how do you declare an object?

Okay I have a program I'm trying to build that lets me navigate between menus...
Main Menu starts up:
(Unimportant)
Then it takes me to another Menu.
When this is over I want to go back:
   System.out.println("Select: ");
        System.out.println("1: to Return to the main menu");
        System.out.println("or");
        System.out.println("0 to Exit");
     if(input.nextInt()==1){
         main(); // <-- error here
     else if(input.nextInt()==0){
         System.exit(0);
        }   It doesnt find the main method because I didn't declare it as an object at the top...
How do I do that?
Edited by: tark_theshark on Mar 30, 2008 5:24 AM

Nah, this has nothing to do with declaring an object, and you really don't want to do this. What you really want to do is to have a loop of some kind, say a while loop and have the loop repeat until the user presses "0". Something like so:
    public static void main(String[] args)
        boolean done = false;
        while (!done)
            if(input.nextInt() == 0)
                done = true;
    }Edited by: Encephalopathic on Mar 30, 2008 6:27 AM

Similar Messages

  • How can you move the objects from one server to another?

    how can you move the objects from one server to another?

    Hi,
    Collecting objects for Transporting
    1. rsa1->transport connection
    2. left panel choose 'object type', middle panel choose 'infocube' and 'select objects'
    3. then choose your infocube and 'transfer'
    4. will go to right panel, choose collection mode 'manual' and grouping only 'necessary objects'
    5. after objects collection finished, create request
    6. If they are $TMP, then change the package.
    7. When you click the Save on the change package, it will prompt for transport. Here you can provide an existing open transport request number, or if you like here itself you can create a new one.
    8. You can check the request in SE09 to confirm.
    Releasing Transport Request  
    Lets say you are transporting from BWD to BWQ
    Step 1: In BWD go to TCode SE10
    Step 2: Find the request and release it (Truck Icon or option can be found by right click on request #)
    Note: First release the child request and then the parent request
    Steps below are to import transport (generally done by basis )
    Step 1: In BWQ go to Tcode STMS
    Step 2: Click on Import queue button
    Step 3: Double Click on the line which says BWQ (or the system into which transport has to be imported)
    Step 4: Click on refresh button
    Step 5: High light the trasnport request and import it (using the truck icon)
    Transport
    http://help.sap.com/saphelp_nw2004s/helpdata/en/b5/1d733b73a8f706e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0b/5ee7377a98c17fe10000009b38f842/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/224381ad-0701-0010-dcb5-d74236082bff
    Hope this helps.
    thanks,
    JituK

  • How do you select an object that is directly under another object?

    How do you select an object that is directly under another object?
    I was working from a template and I wanted to make a text box the same size as a column box that was put there in order to keep the text in the confines of the paper that is was being printed to.
    I could actually put text in each column fine but I wanted it to be in a text box so that I could slightly tilt the test box to compensate for my printer feeding it in slightly wrong. I accomplished this on another template but I could not on this one. If I was working in InDesign or something I know I could just select that layer but I'm at a loss of what to do here. How do I select a column right under a text box? I just thought of something. Once I make the text boxes the same size as the columns I think I can just delete the columns from the inspector. But that would be kind of a work around. I know you can hold down command when nothing is selected from outside the document and then highlight but this is not working. Does anyone have some tips and tricks when it comes to having control over which objects you are selecting when it comes to objects that are overlapped as well as directly over each other.
    Thanks.
    Tim

    I'm not sure it's documented any where, but it's not too difficult. First, ⌘-click outside of the layout area to enter object mode then drag the cursor towards the two objects until you see the handles. Now, again ⌘-click on the top object to deselect it. You can now move the underlying object to the front to edit, delete, etc.
    After typing this, it dawned on me, why not just click the top object to select it & move it to the back? I've only done the other way a bazillion times & now I think of this.

  • How do you remove an object from a picture.  Newbie to program CS6

    how do you remove an object from a picture.  Newbie to program CS6

    Well, generally you can use the clone-stamp tool for one, shortcut is S. It basically allows you to take data from any part of the image and copy that over. What I do is draw on a new layer above the one to modify- make sure you select Sample:"This layer and below" in the top toolbar when doing so. Other ways include blending something on top of the object too, using different blending modes. Painting over it works too at times (rarely). It'd be easier if we knew a specific case though...

  • How do you add an object to a collection typed witha wildcard?

    Hi All,
    I want to add an object to a collection typed with a wildcard but I can't figure out how to do it.
    I've been thru the generics tutorial again and I now understand that I can't do exactly what I want to and why. However I don't know how to do it right. I copy some code below to show the problem:
    private List<? extends HasCriteria> dataList;
    private HasCriteria dataObject;
    public HasCriteria getDataObject() {
            return dataObject;
    public List<? extends HasCriteria> getCollection() {
            if(dataList==null){
                refreshDataCollection();
            return dataList;
       }/*I want to be able to do the add() below but the generics tutorial assures me, as does the compiler, that I can't. So how do I get an object into the collection?? */
    public void create(){
    getCollection().add(getDataObject());
    }/*I don't understand why I can do this setCollection() call below as the compiler has no idea that the resultList is of type HasCriteria, however I accept that it is ok with this*/
    protected <T extends HasCriteria> void setCollection(Collection<T> m) {
                dataList = new ArrayList<T>(m) ;
                for(HasCriteria t: dataList){
                    t.setStatus(HasCriteria.Status.SAVED);
    public void refreshDataCollection(String jpaQL, List modelParameters){
                Query q = em.createQuery(jpaQL);
                List rl = q.getResultList();
                if(rl != null){
                    setCollection(rl);
                    setModelQuery(jpaQL, modelParameters);  
    }

    class GenGen <K extends Shape> {
      private List<K> dataList;
      private K dataObject;
      public K getDataObject() {
        return dataObject;
      public List<K> getCollection() {
        if(dataList==null){
          //refreshDataCollection();
        return dataList;
      public void create(){
        getCollection().add(getDataObject());
      protected void setCollection(Collection<K> m) {
        dataList = new ArrayList<K>(m) ;
        for(Shape t: dataList){
          // t.setStatus(HasCriteria.Status.SAVED);
      public void refreshDataCollection(String jpaQL, List modelParameters){
        List rl = null;
        setCollection(rl);
    }Note that in that final setCollection, you'll get an unchecked conversion warning, if you haven't turned them off.

  • How do you unlock an object in Fireworks CS5?

    Hi There,
    I locked a few objects but now I can't find an unlock command - how do you do this in Fireworks?
    Found a menu in the layers palate which did the trick - pretty cryptic though!
    Cheers
    Ben

    First, make sure the objects are not on a master page. If not, you can either click on the little lock icons next to the objects in the layers panel, or open the layers panel menu and select Unlock All.

  • How do you group connected objects?

    Is there a way you can group objects (in my case text boxes) that have been connected?  When I try to the "Group" button is greyed out, and if I group them first, I'm unable to connect them (greyed out).

    You can't group them, but you can pass them through Preview and get them to one item. To do this, select them all and copy, them open Preview and command-n (or File>New from Clipboard), copy this and paste back into Keynote. Before you do this, make sure your text is how you want it as you can't change it after you do this.

  • How do you declare and call a function?

    I wrote the code that's gonna need to be repeated many different times in my program so i need to make a function that i can call with the code inside it. i tried
    public class MyFunction
       // My code
    }This will compile but as soon as i put some code in that manipulates any variable, it won't compile. it will declare a variable though. For example i can say int i; but as soon as i say i++; OH NO 50 million compiler errors. So what is the proper way to declare a function? How do you call it? Please don't just say read this and send me a link, i always find it hard to follow those tutorials.
    thanks, lateralus

    That's a class, you need a method.
    public void myFuntion()
       //code goes here
    }You can call that method from almost anywhere like this.
    myFunction();

  • How do you "un-unite" objects

    In Pages 5.+, you can "unite" objects. This is Apple's pathetic attempt at allowing linked text boxes, among other things. However, there is no way to "un-unite" text boxes. At least, I can't find one--aside from using the undo feature to undo everything back to the point where I united the text boxes in the first place. Anyone help?

    Nope that's it.
    Why do you persist with Pages 5.5 if that is important to you?
    Peter

  • How do you declare objects in the master database

    I am trying to register our CLR assembly as an unsafe assembly without having to make the database trustworthy.  Since making the database is_trustworthy_on = 1 is not a best practice, and would cause some of our customers (and our development process)
    a little bit of grief.
    I have read a ton about it but am still having trouble.
    The reason the assembly is 'Unsafe' is because it is calling the TimeZoneInfo class to convert between timezones, since we are not yet on UTC dates.  We plan to in the future but that's a big project.
    We are also not using the 'SQLCLR' but rather have written our own class library and just have a project reference to it, which works just the same, but we have found to be better for the C# programmers.
    I am playing with signing the assembly using an SNK file and have figured out what I need to do, including 1) creating a master key, 2) creating an asymmetric key using the same SNK file that signed the assembly, 3) creating a login for the asymmetric key,
    and 4) granting unsafe assembly to the login.
    When I do all that with straight SQL, it actually works!  But I am having trouble fitting this into our SSDT world.
    Should I create a separate SSDT project for items #1 through #4 above, and reference it, and check 'Include composite objects' in our publishing options?  As stated in this blog post though, I'm terrified of messing up the master database, and I'm not
    excited about the overhead of another project, a 2nd dacpac, etc.
    http://blogs.msdn.com/b/ssdt/archive/2012/06/26/composite-projects-and-schema-compare.aspx
    Since we do use a common set of deployment options in a deployment tool we wrote, which does set the 'block on data loss' to false, and the 'drop objects not in source' to true, b/c we drop tables all the time during the course of refactoring, etc. 
    I don't want to drop anything in master though, and I don't want to have to publish it separately if we didn't have to. 
    I suppose I could just have some dynamic SQL in a pre-deployment script that takes care of the master database, but I was trying to do it the 'right' way, in a declarative style, but struggling.
    So, in short, what's the recommended approach for getting an 'unsafe' CLR assembly into an SSDT project?
    The error that started all this was:
    CREATE ASSEMBLY for assembly *** failed because assembly *** is not authorized for PERMISSION_SET = UNSAFE. 
    The assembly is authorized when either of the following is true:
    the database owner (DBO) has UNSAFE ASSEMBLY permission and the database has the TRUSTWORTHY database property on;
    or
    the assembly is signed with a certificate or an asymmetric key that has a corresponding login with UNSAFE ASSEMBLY permission.
    Also, would a certificate be better than an asymmetric key?  I'm not entirely sure of the difference just yet to be honest.
    Thanks,
    Ryan

    After much fighting with this, figured something out as a workaround, and thought I'd share it.
    First, I'm pretty certain the SSDT declarative way for these master objects just doesn't work yet.
    My workaround was to make a pre-deployment script (that runs when we create new databases, as well as for the current release), that takes care of the security items needed to support a signed CLR assembly with unsafe permissions.
    One issue we were running into was when it came to creating the asymmetric key, there are 4 ways to do so, and we didn't want to depend on a hard-coded/absolute file path.  The 4 ways are "From file", "from external file", "from
    assembly", or "from provider".  I still don't 100% understand the from provider way, but ultimately we are actually using the from assembly way, with a little trick/hack I did that allows us to not have to use the 'from file' way and to
    reference a hard-coded path on someone's C:\ drive.  I really really didn't want to do that b/c we create local dev databases all the time and not everyone has the same paths setup.  Also, our databases are deployed on our servers as well as remote-hosted-customer
    servers, and up until now, the database release has not needed file system access.  Even the CLR itself is created using assembly_bits, which is awesome.
    So I thought of something...
    What if I had a simple/temporary assembly, which I create from assembly_bits, use to import the public key from, through the create asymmetric key from assembly command, and then drop as if it never existed?
    Well...it works!
    Here is my current prototype of a pre-deployment script, which I'll go through and cleanup more, but thought I'd share.  I also want to document how I created the temporary assembly_bits in case anyone ever wants or needs to know, even though they really
    shouldn't.  But it should make them feel better.  Basically I just created did this to get them:
    1 - Created a C# Class Library project in the solution.
    2 - Added our .SNK to that project and removed the 'Class1.cs' that it created by default
    3 - Signed that class library with the .SNK
    4 - Added a project reference to that class library from the main database solution.
    5 - Generated a deployment script (but didn't run it) and grabbed the create assembly statement (copy/paste)
    6 - Deleted the temporary project
    7 - Pasted the code I had copy/pasted into the pre-deployment script
    Note that the objects do apparently need to go into MASTER, so at the end of the pre deployment script, I switch back to the automatic [$(DatabaseName)] after first having done USE master.
    Hope this helps someone.  Finally got it!
    BTW - The other way we almost used was to introduce a SqlCmdVariable of $StrongNameKeyFilePath but that would have been a hassle for people to set whenever they got a new machine, etc.
    Thanks,
    Ryan
    PRINT '**************************************************************************'
    PRINT 'Pre\SetupMasterDatabaseKeysAndLoginsIfNecessary.sql'
    PRINT '**************************************************************************'
    PRINT '************************************************************************************'
    PRINT 'If they do not already exist, create the database master key, as well as the asymmetric'
    PRINT 'key, from the Strong-Named File (.SNK) which signed the CLR assembly.  Finally, also'
    PRINT 'create a login from that asymmetric key and grant it the UNSAFE ASSEMBLY permission.'
    PRINT 'This is all necessary b/c the CLR currently has to be referenced for UNSAFE permissions'
    PRINT 'in order to access the TimeZoneInfo class.  This code and these objects can be removed'
    PRINT 'if the system is ever updated to use all UTC dates and no longer requires the TimeZoneInfo class.'
    PRINT '************************************************************************************'
    USE master
    PRINT N'Creating Temporary Assembly [Wits.Database.AsymmetricKeyInitialization]...'
    CREATE ASSEMBLY [Wits.Database.AsymmetricKeyInitialization]
        AUTHORIZATION [dbo]
        FROM 0x4D5BlahBlahBlah;
    IF NOT EXISTS (SELECT 1 FROM sys.symmetric_keys WHERE name LIKE '%DatabaseMasterKey%')
        BEGIN
            PRINT 'Creating Master Key...'
            CREATE MASTER KEY
                ENCRYPTION BY PASSWORD = 'I Removed This Part For This Post'
        END
    IF NOT EXISTS (SELECT 1 FROM sys.asymmetric_keys WHERE name = 'ClrExtensionAsymmetricKey')
        BEGIN
            PRINT 'Creating Asymmetric Key from strong-named file...'
            CREATE ASYMMETRIC KEY [ClrExtensionAsymmetricKey]
                FROM ASSEMBLY [Wits.Database.AsymmetricKeyInitialization]
        END
    IF NOT EXISTS (SELECT 1 FROM sys.server_principals WHERE type_desc = 'ASYMMETRIC_KEY_MAPPED_LOGIN' AND name = 'ClrExtensionLogin')
        BEGIN
            PRINT 'Creating Login from Asymmetric Key...'
            CREATE LOGIN [ClrExtensionLogin] FROM ASYMMETRIC KEY [ClrExtensionAsymmetricKey]
            PRINT 'Granting Permissions to Login created from Asymmetric Key...'
            GRANT UNSAFE ASSEMBLY TO ClrExtensionLogin
        END
    PRINT N'Dropping Temporary Assembly [Wits.Database.AsymmetricKeyInitialization]...'
    DROP ASSEMBLY [Wits.Database.AsymmetricKeyInitialization]
    USE [$(DatabaseName)]

  • How do you know the object is from another database through db link

    I have a table named a2z_people. I searched dba_objects, I found this is a public synonym.
    How can I know the real table name in the another database. Where is this table come from? In another words, what's the source database?
    Thanks!

    In DBA_SYNONYMS, there is a DB_LINK column that names the database link being used (assuming the real object is on a remote database). Is that what you're looking for?
    Justin

  • How do you install Spreadsheet object in lookout?

    I was wondering if anyone can help me, i am very new to Lookout. I want to use spreadsheet objects in Lookout. I have been given some examples to show how to use it, but i am unsure where these files should be stored. i have stored them in the lookout directory, but nothing happened, do i need to compile the files?
    any help or direction would be much appreciated.

    Please don't edit the codes in .lks file. Everything is done in Lookout software, not the notepad!
    The attached pdf is a good manual to learn some basic programming.
    If you want to create a new pot, goto menu bar, Object->Create... select Pot, and then do the configuration.
    If you want to add or change the data field of the spreadsheet object, follow the attached instructions. Select (new field), right click on the yellow bar, choose the pot or object you want to log, then click Save.
    Ryan Shi
    National Instruments
    Attachments:
    350379e.pdf ‏570 KB
    untitled1.JPG ‏109 KB
    untitled2.JPG ‏48 KB

  • How do you rotate an object in the Photoshop CC Animation Timeline now that "3D Object Position" no longer exists?

    I am attempting to animate the rotation of an object using Photoshop CC Animation.  However, unlike in previous versions where there was a "3D Object Position" layer on the Timeline that one would keyframe to change an objects position within the scene; the sublayer "3D Object Position" does not exist in CC.  I have attempted to change an objects rotation by keyframing the "Position" sublayer resulting in no change what so ever.  I have attempted to change an objects rotation by keyframing the "3D Meshes" sublayer resulting in the object rotating clear off the scene and not following the coordinates that I type in.  This is very frustrating since something like this use to be so easy!!  How do I animate the rotation of an object using Photoshop CC?!

    Which version of CC and have you install the updates?
    Supply pertinent information for quicker answers
    The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
    Adobe product and version number
    Operating system and version number
    The full text of any error message(s)
    What you were doing when the problem occurred
    Screenshots of the problem
    Computer hardware, such as CPU; GPU; amount of RAM; etc.

  • OpenScript: How do you test for object/text existance programmatically?

    Hi, All;
    I hope someone can help me; kind of new to OATS. I can’t figure out how to test for object/text existence and return results back to the script. There are methods for verifying text and objects; i.e.
    Web.verifyText
    Web.assertText
    These methods just report pass or fail to the test. I need to get the data back programmatically so I can use it logically. I know you can do this pretty easily in Selenium and QTP so there must be a way in OATS.
    Thanks,
    Eric

    Hi Eric,
    You can use the Object Explorer to find the xpath of the object you are interested and check for its existence, and then grab some attribute of that object for use elsewhere.
    if (web.element(6,"/web:window[@index='0' or @title='Software and Services - SCL']/web:document[@index='0']/web:span[@text='Services' or @index='14']")
                             .exists()){
              System.out.println("OBJECT EXISTS");
    // get an attribute of object here ,e.g
    String myval = web.element(41,"/web:window[@index='0' or @title='Software and Services - SCL']/web:document[@index='0']/web::span[@text='Services' or @index='14'].getAttribute("innerText");
    // use myval elsewhere
    Hope it helps.
    Jamie

  • How do you invert an object's position in Edge Animate?

    How can the position of an object in a scene define the position of another object in the same scene?
    Essentially, if Object A had a position of x=100 y=100, What code would I need to write to make Object B have a position of x=-100 y=-100?
    I would like to move Obbject A around freely and have object B always be an exact inverted position. Is this possible? How?
    Thanks in advance.
    -Stephen

    Which version of CC and have you install the updates?
    Supply pertinent information for quicker answers
    The more information you supply about your situation, the better equipped other community members will be to answer. Consider including the following in your question:
    Adobe product and version number
    Operating system and version number
    The full text of any error message(s)
    What you were doing when the problem occurred
    Screenshots of the problem
    Computer hardware, such as CPU; GPU; amount of RAM; etc.

Maybe you are looking for

  • How do I put my name in my iphone?

    hi! I bought Iphone 5 a few days ago, and I have not put my name in it. How do I do it?

  • Purchase order created by "Procurement Document" is not printed automatical

    Hi all experts, After and upgrade to 8.81 (from 2005A)  some funcionality was lost. In Print Preferences it is set that the document Purchase Order shall be printed automatically when adding document. This works if you add the document directly in Pu

  • There is a little red circle with a 2 in it over my iWeb icon

    Hi There, I have a rather strange problem and I am a bit embarrassed by it, because I don't know what it means. Anyway when I open iWeb 09, there is a little red circle with a little number 2 in it appears over the iWeb launch-bar icon. See this scre

  • Could not read jazn-data config file

    I am using JDev 10.1.2 When deploying my app I am receiving "oracle.oc4j.admin.internal.DeployerException: Cound not read jazn-data config file..." when deploying my app of OC4J 10.1.2. When I deploy directly to an EAR file and open the EAR file I se

  • Writing Code using SQVI

    Hi Experts , Can we write a Abap code (query ) using the Tcode SQVI? Apart from doing table joins and getting the report output . I know we can do it using SQ01 , but i do not have the access for the same. Thanks in Advance , Harshit Rungta