Have a question,please help

class LessonTwoA {
text = "I'm a Simple Program";
public static void main(String[] args){
System.out.println(text);
The Error messages shows "non-static variable text cannot be referenced from a static context".
I think the reason is "the text is not static variable so I have to create an instance of the class(LessonTwoA)",right?
Thanks a lot.

public void static main(String[] args) is a static method, which means that it can only reference variables that belong to the class - i.e. static variables. Generally main is used to run an application and so should not have access to one particular objects instance variables.
Do this
public class Thing {
private static String text = "A string of characters";
public static void main(String[] args) {
System.out.println("text = "+text);
}- hope that helped, Edd.

Similar Messages

  • Migration Complete - SQL Server 2000 - But I Have a Question - Please Help

    I just ran the Oracle Migration workbench and converted a SQL Server 2000 database to Oracle 8i. I did get a few errors and warnings, all from the stored procedures. Which I will correct manually. However, when I log into DBA Studio, I can see the new tablespace for my converted database under storage. But theres nothing under the schema. Do I have to create this in order to manipulate the database. I wanna be able to modify some of the tables and stored procedures, but all I see in DBA Studio is the tabelspace for the converted database.
    I hope someone can help me with this.
    Thanks

    If your migration was sucessfull, then the schema's would also have been created on the target Oracle environment. You can go back to the Workbench and check the oracle model, to determine what schema(s) would be created. You can also check the log, or run a report to determine any errors during the migration phase.
    Donal

  • Hi, I have a question please help me Ladies and Gentlemen!

    My Question is about restrictions passcode which I forgot so how can I solve it?
    Settings- General- Restrictions.

    You will need to restore the phone:
    Use iTunes to restore your iPhone, iPad, or iPod to factory settings - Apple Support

  • HT2968 I can not update several of my apps that i have purchased a while back in my Apps Store on my MacPro. Because it keeps using my old @me account for iTunes and i don't remember the password or security question, Please help?

    I can not update several of my apps that i have purchased a while back in my Apps Store on my MacPro. Because it keeps using my old @me account for iTunes and i don't remember the password or security question, Please help?

    Hi AlphaCentori,
    If you are having issues accessing the Apple ID that was used to originally purchase those apps, you may find the following article helpful:
    Apple Support: Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/ht5312
    Regards,
    - Brenden

  • My apple id have been blocked an i do not remember the identity or security question please help what can i do?

    my apple id have been blocked an i do not remember the identity or security question please help what can i do?

    If your account is disabled you might be able to re-enable it via this page : http://appleid.apple.com, then 'reset your password'
    You might then need to log out of your account on your iPhone and iPad by tapping on your id in Settings > iTunes & App Storeand then log back in so as to 'refresh' the account on it.
    For your security questions, if you have a rescue email address (which is not the same thing as an alternate email address) on your account then the steps half-way down this page will give you a reset link on your account : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address then you will need to contact Support in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699 (you can also try this link if you can't get your account enabled via the above)
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

  • Hi, I have traveled the country and have forgotten my security questions please help me thank you

    Hi, I have traveled the country and have forgotten my security questions please help me thank you

    Call Apple to help reset your Security Question.
    http://support.apple.com/kb/HT5699

  • HT201363 Hello, I have my pass word, I have my Apple ID, but itunes think I am buying a song for the first time and is asking me 2 security questions, please help, what should i do?

    I cannot remember the answeres to my security questions, please help.

    You need to ask Apple to reset your security questions; this can be done by phoning AppleCare and asking for the Account Security team, or clicking here and picking a method, or if your country isn't listed in either article, filling out and submitting this form.
    They wouldn't be security questions if they could be bypassed without Apple verifying your identity.
    (105959)

  • I want to change my apple id password but I forgot the security questions please help me some using my icloud I'd

    I want to change my apple id password but I forgot the security questions please help me some using my icloud I'd and if confirmation is must so please phone number is mine please send a code please help me my apple

    Welcome to the Apple community.
    If you are unable to remember your password, security questions, don’t have access to your rescue address or are unable to reset your password for whatever reason, your only option is to contact AppleCare, upon speaking to an operator you should explain that your problem is related to your Apple ID, this way you will not be charged for assistance, even if you don’t have an AppleCare plan.
    The operator will take you through some steps you may have already tried, however they need to be sure they have exhausted all usual approaches before trying to reset your account, so you should try to be helpful and show patience with the procedure.
    The operator will need to verify they are speaking to the account holder and may ask you some questions that only the account holder could know, and you will need to answer them if the process is to proceed.
    Once the operator has verified your identity they will send a message through to your device which contains an alpha numeric code, which you will need to read back to them.
    Once this has been completed they will send an email to your iCloud email address after a period of 24 hours, so you should check that mail is enabled in your devices iCloud settings.
    Upon receipt of the email, use the reset link provided to reset your password, after which you should be able to make the adjustments to iCloud that you wish to do.

  • Hi I live in Iran and I forgot the answer to the security question please help me thanks

    Hi I live in Iran and I forgot the answer to the security question please help me thanks

    How to reset your Apple ID security questions.
    Go to appleid.apple.com, click on the blue button that says 'Manage Your Apple ID'.
    Log in with your Apple ID and password. (If you have forgotten your Apple ID password, go to iforgot.apple.com first to reset your password with a password recovery email)
    Go to the Password & Security section on the left side, and click on the link underneath the security questions that says 'Forgot your answers? Send reset security info email to [email]'.
    This will generate an automated e-mail that will allow you to reset your security questions.
    If that doesn't work, or  there is no rescue email link available, then click on 'Temporary Support PIN' that is in the bottom left side, and generate a 4-digit PIN for the Apple Account Security Advisor you will be contacting later.
    Next, go to https://getsupport.apple.com
    (If you see a message that says 'There are no products registered to this Apple ID, simply click on 'See all products and services')
    Choose 'More Products & Services', then 'Apple ID'.
    A new page will open.
    Choose 'Other Apple ID Topics', then 'Forgotten Apple ID Security Questions'.
    Click the blue 'Continue' button.
    Select the contact option that suits your needs best.

  • I do forgot my Apple ID security question, please help me how to rescue email address or how to reset Apple ID security questions?

    I do forgot my Apple ID security question, please help me how to rescue email address or how to reset Apple ID security questions?

    From another post:
    On your browser, whether Safari, Google Chrome or otherwise, navigate tohttps://appleid.apple.com.
    Once here click Manage your Apple ID button and sign into your iCloud account. Here, on the left side select Password and Security and this will list options on the right side. You should be able to see an option to reset your security questions.
    Note other links in realtion to rescue email address:http://support.apple.com/kb/HT5312
    If you cannot see or reset your security question, or even obtaining an error, then you would have to contact Apple directly: http://support.apple.com/kb/HE57. Here you would explain the issue, transfer you to an Account Security Agent who will be able to veritfy your identity and assist you in the resetting of you security questions.

  • I logged 3 times wrong security question. please help me

    I logged 3 times wrong security question. please help me

    Hey annamyle91,
    Thanks for the question. If you are having issues with the security questions associated with your Apple ID, follow these steps:
    If you forgot the answers to your Apple ID security questions
    http://support.apple.com/kb/HT6170
    Reset your security questions
    1. Go to My Apple ID (appleid.apple.com).
    2. Select “Manage your Apple ID” and sign in.
    3. Select “Password and Security” on the left side of the page.
    4. If you have only one security question, you can change the question and answer now.
    5. If you have more than one security question:
              - Select “Send reset security info email to [your rescue email address].” If you don't see this link or don't have access to your rescue address, contact Apple Support as described in the next section.
              - Your rescue address will receive a reset email from Apple. Follow its instructions to reset your security questions and set up new questions and answers.Didn't receive the email?
    After resetting your security questions, consider turning on two-step verification. With two-step verification, you don't need security questions to secure your account or verify your identity.
    If you can't reset your security questions
    Contact Apple Support in either of these circumstances:
              - You don't see the link to send a reset email, which means you don't have arescue address.
              - You see the link to send a reset email, but you don't have access to email at the rescue address.
    A temporary support PIN isn't usually required, but Apple may ask you to generate a PIN if your identity needs to be verified.
    Thanks,
    Matt M.

  • Apple ID I forgot my security question please help me

    Apple ID I forgot my security question please help me

    You might try to see if you can change your security questions. Start here, change your country if necessary and go tomanage your account > Password and Security.
    I'm able to do this, others say they need to input answers to their current security questions in order to make changes, I'm inclined to think its worth a try, you don't have anything to lose.
    If that doesn't help you might try contacting Apple through Express Lane (select your country, navigate to iCloud help and enter the serial number of one of your devices)

  • HT6170 hi,i forget secirity question please help me : ********

    hi,i forget secirity question please help me : *******
    <Edited by Host>

    Hi habibaljalil,
    Welcome to Apple Support Communities.
    The article linked below provides the available options for resetting your security questions.
    If you forgot the answers to your Apple ID security questions
    If you can't reset your security questions
    Contact Apple Support in either of these circumstances:
    You don't see the link to send a reset email, which means you don't have a rescue address.
    You see the link to send a reset email, but you don't have access to email at the rescue address.
    A temporary support PIN isn't usually required, but Apple may ask you to generate a PIN if your identity needs to be verified.
    I hope this helps.
    -Jason

  • HT1918 i need to security questions please help me

    i need to security questions please help me
    <Email Edited by Host>

    Read this about how to change the security questions: http://support.apple.com/kb/HT5312
    If you can't use these procedures because you don't have a rescue email address you will have to contact Apple. See http://support.apple.com/kb/HT5699

  • I have tried everything, even erasing content on mI have tried everything, evey iPad and I am still being asked to put in credit card information to download free apps and update apps that I already have. Someone please help me!!!! This started 3 days ago

    I have tried everything, even erasing content on my iPad but I am still being asked to submit credit card information for free apps. I am also being asked the same thing to update apps which I already have. Someone please help!!!!

    See the following:
    http://support.apple.com/kb/HT2534

Maybe you are looking for