I have a question about the data type static

for any of you that read my last post for my assignment this is still the same thing but i have broke it down more, but i am getting an error and i am not for sure i understand why that is. I think i am confused on why i should, or could use a static?
thanks again guys
package wordstester;
import javax.swing.JOptionPane;
* @author christopher izatt
public class WordsTester {
     * @param args the command line arguments
    public static void main(String[] args) {
              // prompt the user to enter a string of their choice
      String wordChosen;
      wordChosen = JOptionPane.showInputDialog
          ("Please enter a word of your choice here");
      String middlePart;
      middlePart = Words.getMiddle(wordChosen);      <----- error nonstatic method can not be referenced in a static context
      System.out.println("At the middle of " + wordChosen + " is: "
                 + middlePart);
package wordstester;
* @author christopher izatt
    public class Words {
    private String wordChosen;
    public String Words(String letters) {
        wordChosen = letters;
        return wordChosen;
    public String getMiddle(String wordChosen) {
        int letters = wordChosen.length() / 2;
        int endindex = letters +1;
        return wordChosen.substring(letters, endindex);
   

Try this.
Imagine a blueprint from which houses are constructed. The blueprint indicates that each house will have a garage, a roof, a front door, etc. However, each house will have its own roof - be it a tar shingle roof or a cedar roof or maybe thatch - but that's another issue.
Now, in the lower left corner of the blueprint, we find the architect's name and company logo. That logo is part of the blueprint - each house will NOT have its own discreet copy of that item. Instead, each house will share the one and only copy of that logo.
That's what static members are. They are called "class variables" or "class methods" and are accessed through the class name instead of an object name.
I hope that helps.

Similar Messages

  • Question about the Filter type for the trace provide "Microsoft-Windows-Kernel-File"

    Hello all,
    I have moved this question from the Windows
    Server General Forum accorfing to the suggestion from Mr. Justin Gu 
    I have a question about the Filter function for the trace provider "Microsoft-Windows-Kernel-File".
    I can find the Filter function with the following operation.
    Mr. Justin Gu wrote:
    > You create a Data Collector Set for the trace provider "Microsoft-Windows-Kernel-File" and finish completely, then you > can right click it and select Properties.
    In the Properties dialog box, click Filter and
    then select ‘Edit…’. You will be> able
    to see the Filter type and Filter data in the Filter dialog box.
    What
    Kind of Filter can
    I use in this Filter dialog box?
    And, how can I set to exclude the some kind of datas?
    Could you give me your suggestion?
    Thank you.

    What
    Kind of Filter can
    I use in this Filter dialog box?
    And, how can I set to exclude the some kind of datas?
    Could you give me your suggestion?
    Thank you.
    I'm looking for the same information.

  • Hello my company Favorites I would like to first thank you for this wonderful program I have a question about the program. How can I Arabization program In your response to the spread accept me thanks and respect

    Hello my company Favorites I would like to first thank you for this wonderful program I have a question about the program. How can I Arabization program In your response to the spread accept me thanks and respect

    Hi ,
    You might want to refer the following link to find your serial number and activate your software .
    Here is the link for the same.
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Let us know how it goes .We'll do the best possible to get your issue fixed.
    Regards
    Sukrit Dhingra

  • I have a question about the new share everything plan.

    Hi,
    I have a question of the cost of the new share everything plan. I looked at the options and prices for different phones. Next to smartphone it says 40 dollars, next to basic phone it says 30 dollars etc etc. Does that include the unlimited texts, and minutes? If so, how much would this plan cost for 2 smart phones and one basic phone with the unlimited minutes, unlimited texts, and 2gb of data cost per month?
    Thanks!

    yeah, the line access fee (40 for smartphones, 30 for basic, etc) includes unlimited talk/text and access to the pooled data allowance. It would be $170/month before insurance and taxes and fees for the 2GB plan($60), 2 smartphones ($40*2) and a basic phone ($30)

  • I have a question about the calendar on the ipad2. I have multiple calendars in different colors. Some of the events are filled in with color. Others are just listed with a colored dot in front of the event. Any ideas why events ar showing up differently?

    I have an ipad2 and my question is about the calendar. I set up multiple calendars with different colors. Some of the events show up in filled color. Others only show with a colored dot in front of the event. I can't figure out why some show up one way and others show up differently? Any thoughts?

    On mine the ones that show on a coloured background are all-day events, the ones with dots and just timed events.

  • I have a question about the shuttle

    hello,
    I'm trying to create a shuttle for the multiselection.
    I have 2 tables "offerte" and "attivita", on the table offerte there are ID, ID_cliente, ID_attivita,  Data.
    In the table  attività there are  ID, Descrizione_breve.
    I created the shuttle in the form of Offerte on the attività (descrizione_breve),
    but after saving it does not show the attivita in the report of offerte.
    Can anyone help me?
    thanks in advance

    Your shuttle's source type is SQL Query. Why can't you change the source type as 'Database Column' ? Why are you using the below query as source of the Shuttle??
    SELECT ID FROM TIPO_ATTIVITA WHERE ID = :P5_ID_TIPO_ATTIVITA ORDER BY descrizione_breve
    I think there is no use for this query in source of the shuttle. Try to change source type of shuttle as Database Column and try to submit the page. It will insert into table. If it is not insert into the table then create a process to insert into the table after submit and give the condition as 'Never' in Automatic Row Processing (DML) process.
    Thanks
    Lakshmi

  • I have some questions about the ios 7.1 security -what if they replace the sim ?

    i khnow now that with the new ios 7 no one ever can format the iphone with itunes if the find my iphone is on in the iphone
    but
    1-what if they remove the sim and put a new sim?
    can i still be able to track it with icloud and send messages to it and play sound and lock it with a passcode even if they remove the sim
    2-what if they using an old version of itunes will they be able to format it as new iphone?
    please answer each question both of them
    i have iphone 4s with the latest ios 7.1

    1-what if they remove the sim and put a new sim?
    can i still be able to track it with icloud and send messages to it and play sound and lock it with a passcode even if they remove the sim
    As I said, if there is a passcode in place they do not know, you will be able to track down the device, irrespective the SIM card they are using. By the way, if the device is locked, they should first unlock it in order to make their SIM work, calling the carrier and giving all your personal data they do not have.
    On the other hand, if the phone is unlocked and does not have any passcode, then yes, they will be able to use any SIM with it and turn off any tracking software.
    2-what if they using an old version of itunes will they be able to format it as new iphone?
    Same as in previous: if they have the iPhone without any lock then yes, they will be able to restore it as a new phone.
    Follow all the instructions here: http://support.apple.com/kb/HT5818 in order to turn on Activation Lock and make more difficult for them to restore your phone without permission.

  • Question about the data in 2LIS_04_P_COMP extractor (0pp_c05 infocube)

    Hi gurus.
    My Organization need to compare between the materials that go in to the production process and the materials that located inside the products that go out from the production process.
    In the R/3 there is a calculation that divides the loss of material in the process amongst the final productions, so the loss material goes back to the full picture.
    This calculation called DUV (Distribution of Usage Variances).
    I want to know if the data that extract to BW through 2LIS_04_P_COMP is after this calculation or not.
    An answer from what table dose this extractor takes the data can help as well.
    I can not find any documentation about it.
    Maybe some one can help me.
    Thanks in advanced
    Hagai Jacoby – BW advisor

    Dear Adir,
    This datasource gets data from AFKO and AFPO tables in R/3
    Hope it helps.
    Thanks,
    Krish

  • HT5557 I have a question about the ipad 4 online book store

    Hello! I have a question. In the apple ipad book store how do I get the online store back the the American version? I somehow swtiched it to UK! Thanks!

    Try going to the bottom of the Books tab in the ibookstore in the iBooks app on your iPad and tap on your account id, tap on 'View Apple ID' on the popup and log into your account, and then select the Country/Region section and select the US.

  • I have a question about General Data Selection in Report Painter

    Please help me out. Thi is the question....here it goes.
    In a Report in ReportPainter, I have in the General Data Selection the following selected characteristics. They are:
    Ledger = 0
    Record Type = 0
    Version = 1
    Fiscal Year = Z-ANOACT
    Period = (1CPERIV, 1CPERIB)
    So that we have the next screen in the Report’s execution.
    Fiscal Year : 2006
    From Period : 1
    To Period : 12
    Note:
    *Z-ANOACT = Variable so that with a user-exit calculates the actual year. Right now is 2006.
    *1CPERIV = This From-Period Variable is referenced to CCSS Table and PERBL Field Name. Its default value is 1.
    *1CPERIB = This To-Period Variable is referenced to CCSS Table and PERBL Field Name.
    Its default value is 12. Rigth now, we are in the fiscal month 5 (November).
    Id like to filtrate information from January,2006,Period:07 to November,2007,Period:05.
    I mean I work with the fiscal calendar because the information to get from the table is saved due to this calendar.
    The Fiscal Calendar is from July to June:
    Month          Period     Year
    January          07     2006     
    February     08     2006
    March          09     2006
    April          10     2006     
    May          11     2006                   
    June          12     2006
    July          01     2007
    Augost          02     2007
    September     03     2007     
    October          04     2007
    November     05     2007
    December      06     2007
    Right now, we are in November , 2006 (month=11) but according to the fiscal calendar we are in November, 2007 (month=5).
    How I can accommodate my variables or what I am doing wrong so that I can select information from periods 7 to 12, 2006 ( January to June, 2006) and information from periods 1 to 5, 2007 (July to November, 2007) having the screen cited above so that report painter adds the 2 ranges.
    I cannot do it with the criteria selection cited above because I only have a year and a range of periods and my end-user doesnt want to run my report twice:
    One run with periods 7 to 12, 2006 and
    Another run with periods 1 to 5, 2007 and then to add the 2 reports in excel to form a report.
    Hed like something in my screen like this……
    Fiscal Year = 2006
    From period = 7
    To Period = 12
    Fiscal Year = 2007
    From period = 1
    To Period = 5
    And then report painter will add the 2 ranges.
    Many Thanks if you know anything that can help me, please let me know.

    Please help me out. Thi is the question....here it goes.
    In a Report in ReportPainter, I have in the General Data Selection the following selected characteristics. They are:
    Ledger = 0
    Record Type = 0
    Version = 1
    Fiscal Year = Z-ANOACT
    Period = (1CPERIV, 1CPERIB)
    So that we have the next screen in the Report’s execution.
    Fiscal Year : 2006
    From Period : 1
    To Period : 12
    Note:
    *Z-ANOACT = Variable so that with a user-exit calculates the actual year. Right now is 2006.
    *1CPERIV = This From-Period Variable is referenced to CCSS Table and PERBL Field Name. Its default value is 1.
    *1CPERIB = This To-Period Variable is referenced to CCSS Table and PERBL Field Name.
    Its default value is 12. Rigth now, we are in the fiscal month 5 (November).
    Id like to filtrate information from January,2006,Period:07 to November,2007,Period:05.
    I mean I work with the fiscal calendar because the information to get from the table is saved due to this calendar.
    The Fiscal Calendar is from July to June:
    Month          Period     Year
    January          07     2006     
    February     08     2006
    March          09     2006
    April          10     2006     
    May          11     2006                   
    June          12     2006
    July          01     2007
    Augost          02     2007
    September     03     2007     
    October          04     2007
    November     05     2007
    December      06     2007
    Right now, we are in November , 2006 (month=11) but according to the fiscal calendar we are in November, 2007 (month=5).
    How I can accommodate my variables or what I am doing wrong so that I can select information from periods 7 to 12, 2006 ( January to June, 2006) and information from periods 1 to 5, 2007 (July to November, 2007) having the screen cited above so that report painter adds the 2 ranges.
    I cannot do it with the criteria selection cited above because I only have a year and a range of periods and my end-user doesnt want to run my report twice:
    One run with periods 7 to 12, 2006 and
    Another run with periods 1 to 5, 2007 and then to add the 2 reports in excel to form a report.
    Hed like something in my screen like this……
    Fiscal Year = 2006
    From period = 7
    To Period = 12
    Fiscal Year = 2007
    From period = 1
    To Period = 5
    And then report painter will add the 2 ranges.
    Many Thanks if you know anything that can help me, please let me know.

  • Verizon iPhone - mobile hotspot and other questions about the data options

    I just ordered the Verizon iPhone. Can anyone explain the options here:
    1) Unlimited corporate email & Web (business and personal email) vs. Unlimited email and web for smartphones (personal email) - what's the difference?
    2) "3G Mobile Hotspot 2GB" - does this mean that there's no way I can share my 3G connection via wifi without paying the extra $20/month?? How about tethering to a single computer (USB, BT, or WiFi) - does that also require this extra option?
    3) equipment protection - what's the difference between Extended Warranty, Asurion Wireless Phone Protection, and Total Equipment Coverage?
    thanks in advance,
    Mike

    Hi
    Regarding your #2 question; yes, you must pay $20/mo to use the 3G Hotspot aspect of the iPhone, same as with any of Verizon's phones that offer this feature such as the Droid X, HTC phones, etc. And, there is NO additional charge to tether it to your computer; it's $20/mo regardless. You can still use the iPhone's WiFi feature to search the web which is part of the regular data plan. We're only talking about paying the $20/mo for the "up to 5 devices" jumping on your phone as a hot spot.
    I'm an Apple fan, have my MacBook Pro, but my phone is a Droid X. I've been a Verizon member since a year before they became Verizon. Additionally, I am part of the Verizon & Motorola test forum; testing new software updates as they come along.
    Something you should know about Verizon's 3G Hot Spot feature; it has issues. Those of us in the Motorola & HTC forums have experienced identical issues with regard to the 3G Hot Spot feature; it disconnects every 2 minutes, even when you are actively surfing the net. Verizon & Motorola Support have been very helpful to provide what they believe are fixes, including: changing the channel, hard resets, clearing cache, etc. It does not work. Most of us believe, this is NOT a Verizon issue, but a phone maker issue.
    I also have Verizon's MiFi 2200. It costs $59/mo and is purely a hot spot device; again up to 5 devices. I use it at home, for my lap top and for those who need connectivity. It outperforms the 3G hot spot feature of the Motorola & HTC phones by leaps & bounds, and I suspect it will out perform the 3G hot spot feature on the iPhone. Additionally, you get 5GB of download with the MiFi which Verizon is planning on offering increases to 8GB & 10GB. There is NO plan to increase the 2GB download limitation on the 3G Hot spot of the iPhone & other phones, and anyone who does basic software downloads & pics, knows 2GBS is not a lot space.
    So, I would recommend not paying the $20 until this is resolved. If you do, you could pay $39 more for a total of $59/mo for the MiFi, download the software to you home computer & notebook, and end up canceling your home internet service. I did this and have saved $70/mo in my total utilities.
    One other important note: Verizon's VZManager Software for their phones & MiFi. If you did pay the $20/mo for the iPhone and decided to tether to your USB port (for power while using) and you were to use the 3G hot spot feature, it will NOT work on 64 Bit computers, regardless if you are using the WiFi feature or directly using VZManager. The MiFi has this same issue. It will only work on 32 Bit when tethered. So, you'd have to reboot your computer to 32 Bit, if you have that ability. On a Macbook Pro, simply restart holding down the "3" & "2" keys.
    I have no idea why Verizon can't simply upgrade the firmware, even recent firmware upgrades have not resolved this. Most new computers are 64 Bit now.
    Despite this, I use my MiFi 100% untethered and carry my charge cord in my bag as it also works on my Droid, and I presume they may do the same for the iPhone; reduces the need for multiple power cords.
    I really looked forward to the 3G feature of the Motorola & HTC phones, but honestly, it's just not there yet; mine was slower than Dial Up, and I'm not kidding.

  • I have a question about the security of photo printing kiosks.

    Specifically, I'd like for anyone who knows more about such things to tell me if I did something very stupid.
    This past weekend, I found myself in a situation where I wanted to get a picture from my phone printed very quickly. I had not very many options available to me (it was Sunday, and there were no printing shops open anywhere nearby that I could access the picture via email). I ended up using a Walgreens/Duane Reade photo printing kiosk. I was able to directly connect my phone with a data cable and print the picture from my camera roll.
    I was relieved to get the picture, but in retrospect I am very worried that connecting my phone to a public station like that was stupid, and that I might have opened myself up to malware or put my data in jeopardy. Is this something I should be worried about? If so, are there any instant precautions I should take? I welcome any harsh words.
    I have an Iphone 5 with the most recent update to IOS7.
    Thanks in advance, folks!

    I was relieved to get the picture, but in retrospect I am very worried that connecting my phone to a public station like that was stupid, and that I might have opened myself up to malware or put my data in jeopardy.
    Yes and yes.  There's a reason why iOS 7 asks you if you trust the computer you've just connected it to.
    http://www.v3.co.uk/v3-uk/news/2286154/black-hat-researchers-exploit-iphone-flaw s-with-charger-attack
    Whether or not anything DID happen, I cannot say.

  • I have a question about the Siri function.

    Here in Belgium, we speak Dutch and also French and English. But I think when you use the Siri function it is always easier to use it with your own language ( Dutch). 28th October, the iphone4S will be launched here in Belgium, but only with a Englisch version of the Siri function. So my question is that you have any idea when te Dutch version will be available in Belgium, or when i buy an iphone 4S with English version that I can update it to a Dutch version when it will be launched..
    Thank you for helping
    Dylan

    Nobody here can tell you anything more about Apple's plans than what they have already publicly stated, which is that more languages were promised for later (including Japanese, Chinese, Korean, Italian, and Spanish in 2012).

  • I have a question about the Nemo Reef game?

    I decided to find a new game to play &amp; I started playing the Nemo reef game because it's always been my favorite movie since it came out even if I am 21 now.
    On the game on the side where Nemo marlin or any of the other fish ask you to plant &amp; grow a certain plant or whatever or when you have home work or a project why is it if there are multiple ones that say something about planting and growing a rare plant &amp; a certain amount why don't they all or some go away when another is done for almost the same task? Like say one says to plant &amp; grow 5 rare &amp; another says 3 why doesnt the 3 one to away if you had accomplished the 5?
    And another thing how are you suppose save up on the sand dollars &amp; algae if they're asking you to plant so many plants or coral or whatever &amp; they cost so many sand dollars or use to many algae to grow &amp; they longgggg to grow or after they grow take so much time to produce sand dollars or algae?

    I think you need to contact the developer of the game for this question. Or want till another Nemo fan hits this forum. Good luck.

  • Getting an iPod Hi-Fi soon, but I have a question about the remote...

    Hi,
    I would greatly appreciate anyone's response to this simple question. Basically, when I purchase my iPod Hi-Fi, I am going to connect it to my DVD player, but I also have my Mac Mini next to my TV (close to where the iPod Hi-Fi will be). The question is will I have to have two Apple remotes to control both the Hi-Fi and the Mac Mini, or can I simply use one remote with both devices? And, if I can use one remote, will I be able to do that from my sofa, or will I have to get up, point the remote close to the device, and control it? Again, any answer would be more than helpful. Thank you all very much!

    Hi,
    Have a read, hope it give you better understanding about remote
    http://docs.info.apple.com/article.html?artnum=303347

Maybe you are looking for

  • Applet not opening a socket on its own host. Please help.

    I have also posted this in JSC2 forum. My applet is not able to open a socket on its own host. The applet is being served by a JSP (developed using Sun Creator2) from my laptop behind a DHCP broadband router at (say) 125.238.104.132 at my residence.

  • Get Data Detail Park Document FI

    Dear Master SAP, I have a little difficulty about the park on the AP Invoice document. At the time of running tcode FBV2, then click the Simulate button. I've seen some articles about the park and whether the FI doc is to calculate the tax computatio

  • Mapping between SAP work process and db2 application/applications ?

    Hi, I want to identify what db2 application(s), maps to particular SAP work process.(when I mean db2 application I mean entry in "list applications" command output) Both db2 "list applications" and SAP work process lists PIDS of processes they belog.

  • Play music on iphone without streaming from match

    Hi, I purchased iTunes Match, synced it with my desktop and have downloaded some songs to my iphone.  How do I play only the "local" songs.  If I have a playlist that doesn't have some of the local songs - it will stream (and use up some of my data).

  • Vista 64-bit Hot Sync and Palm Desktop

    Does anyone know when Hot Sync and Desktop will be available for 64-bit Vista? Thanks, Bob. Post relates to: Zire 21