• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

What exactly is an array modifier?

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks in advance. I'm being nitpicked and my nitpicker says if I "just" Google "modifier", I should be able to figure out what the nitpick means:

public class Say
{
static String numberNameOnes[] =
you missed a previous nitpick. Modifiers.
{
"Zero" , "One" , "Two" , "Three" , "Four", "Five", "Six", "Seven", "Eight", "Nine"

means. I asked if it was my long name numberNameOnes[], the camel casing or what. I was told to look it up, but there is no index listing ANYWHERE IN ANY BOOK and when I Google "modifiers," I get a zillion hits that don't look like ANYTHING I am looking for.
When I got the Say assignment, I looked at the instructions and I followed them to a "T." Now I feel I am getting absolutely nowhere.
Please help!!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When in doubt, consult the Oracle Java Tutorial Or search for "Java modifiers".

This may help: http://docs.oracle.com/javase/tutorial/java/javaOO/accesscontrol.html
 
Jessica Stensrud
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok - so a modifier is public, static, private, etc. but I used the example program as the basis of my program and the class was public and the arrays were static in that example.
Ok - go ahead and make fun of me for using an example to create my program.

So how am I supposed to know what my nitpicker wants me to change the modifiers to and why should I change them?
The program works with things the way they are.
I KNOW I'm trying to learn a lot of ins and outs of Java, but . . . am I supposed to change the static String numberNameOnes[] = to public String numberNameOnes[] = when I didn't understand why it was set to static to begin with??
erg
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure what the exact requirements of the nitpicking are, but it's good practice not to make things static unless there's a good reason for it, and to restrict visibility as much as possible.
 
Greenhorn
Posts: 22
Mac Netbeans IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe this will help: does numberNameOnes[] need to be visible to all objects external to class Say? Or, should it only be accessible internally to class Say? As far as static is concerned: will any objects of class Say use individual intstances of numberNameOnes[]? Or, will all objects of class Say use the same data contained in numberNameOnes[] everytime? If you can answer these questions, it may help with understanding which access modifiers to use in a class.

Steve
 
Jessica Stensrud
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, Steve, I'll have to chew on that for a while! It is helping me wrap my head around the definition of the various array modifiers and what they do.
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic