Simple array

Hi. I'm trying arrays as a beginner and keep running into the same problem. The error I keep getting is "class, interface or enum expected". I recently installed the new Java 1.6.0_06....
I started off with a array of arrays and since that didn't work I tried a very simple one which didn't work either.
http://mindprod.com/jgloss/compileerrormessages.html has a glossary of error meanings which I tried but didn't work.
Thanks.
public class Array1 {
     int[] arr = new int[] {1,2,3,4,5};
     public static void main(String[] args) {
     for (int i : arr) {
          print.out.println(i);
     }

nevermind
Edited by: JacobsB on May 21, 2008 4:20 PM

Similar Messages

  • Simple array of Strings

    Hi, I am new to LabView, however I have programmed in various languages to a moderate level.
    I have attached the vi that I am working on to test a simple array.
    All I want it to do for just now so I can get my head around LabView arrays is simply add the string to the array each time the button is pressed.
    So each time the button is pressed I want to add an new element to the array. So after say 10 presses there should be 10 elements
    Regards,
    jmcall10
    Attachments:
    array-test.vi ‏9 KB

    Some general suggestions:
    Use latch action boolean (right-click..mechanincal action). This way it is true until read by the code, the reverts autoamtically back to false (no need for the local variable).
    Your sequence structure has no purpose. Adding to the array is basically instantaneous, so you can add the delay outside. The execution order does not matter.
    Pachi: Your Current VI has no wait unless you press the button, meaning it spins like crazy, consuming all CPU while doing nothing. The wait should be outside the case.
    Pachi: You need to initalize the shift register, else it remembers the data from previous runs.
    Pachi: It is much less efficient to add to the beginning of the array. I recommend to add the new element to the end.
    Here's a quick draft...
    (personally, I would use an event structure, but this should get you started).
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    AddToArray.png ‏25 KB

  • Simple arrays

    hi,
    I am having difficulties with this very simple array (following). I want to store data through a while loop which is why I tried with a very simple example. And it doesn't work. The data is erased every loop, and i must set the dimension of the array (100 for this example) to get something or my array stays at 0... but I won't know it in my VI.
    Thanks for the help!
    Solved!
    Go to Solution.

    Since you are using Replace array element the element needs to exist prior to rewriting the element.
    Here are two examples in on shot:
    The upper one uses autoindexing, this has the disadvantage that you don't have the data until the loop is finished.
    The lower one uses append array element and feedback notes.
    Ton
    Message Edited by TonP on 06-29-2009 11:24 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    AppendAutoIndex.png ‏3 KB

  • Simple array comparison not working. Please HELP!

    I have been struggling to solve this problem for a few days now, and I'm slowly losing my mind.
    I am in Adobe Acrobat 10.
    I have a group of button fields called: btn0, btn1, btn2, etc.
    I have a group of text fields called: txt0, txt1, txt2, etc.
    I have a script that takes the value of txt0 and makes it the caption for btn0, and so on.
    I have a script that sets the MouseUp action of btn0 to setFocus to txt0, and so on.
    These scripts work fine.
    I have a script that takes the values of all the txt fields and puts them in an array, and sorts it.
    I have a script that takes the array[0] item and makes it the caption for btn0, and so on (alphabetizing my list of buttons).
    Those scripts work fine.
    I am trying to compare the value of the array[0] item to each of the txt fields to find the match, and then set the MouseUp action of btn0 to setFocus to the matching txt field, and so on (so my alphabetized list points to the correct locations).
    This is where I'm at a loss.
    Here is what I have:
    //specified the txt fields
    var txt0 = this.getField("Z name");
    var txt1 = this.getField("A name");
    //etc.
    //put their values into an array called rxArray
    var rxArray = [txt0.value, txt1.value]; //etc.
    //sorted the array
    rxArray.sort();
    //set the captions equal to the sorted array items
    for (var i = 0; i < 5; i++) {
        var b = ("btn" + i);
        this.getField(b).buttonSetCaption(rxArray[i]); //works fine; alphabetizes the list of buttons
        //below is what goes wrong
        for(var x = 0; x < 5; x++) {
            var r = ("txt" + x);
            if(rxArray[i] == r.value){
                var s = (r + ".setFocus();");
                this.getField(b).setAction("MouseUp", s);
    //end
    Here is what I know:
    The alphabetizing and labeling works fine, but the buttons' MouseUp scripts don't work at all. Nothing happens.
    If I change the following piece of the above script:
            if(rxArray[i] == r.value){
                var s = (r + ".setFocus();");
                this.getField(b).setAction("MouseUp", s);
    To this:
            if(rxArray[i] == txt1.value){
                var s = (r + ".setFocus();");
                this.getField(b).setAction("MouseUp", s);
    Because rxArray[0] does equal the value of txt1 ("A name"), then the MouseUp script for btn0 gets set to:
    txt4.setFocus();
    So I know that, each time the nested loop runs, the if statement is true, and the setFocus script updates. Until the end of the loop, leaving the setFocus as the last item run. So why doesn't my script work? It should only update the setFocus script IF the array item matches the txt field, and should set it to THAT txt field.
    Please please help. I know I'm missing something simple in there somewhere.

    @Try67:
    That's a good question. I was running into some other issues and have revamped my code. Here is what I have in my test file:
    A list of five buttons and a list of five text fields. One additional button that sets the focus to the next empty text field to add a new item, and two additional buttons, one that sorts my list alphabetically, and one that unsorts it.
    with the following field names
    The sort button calls function sortName and the unsort calls function sortNumber (the order of entry).
    Here are those scripts in final form:
    function sortName() {
    //first reset the captions for the buttons to blank
    for (var a = 0; a < 5; a++) {
        var b = ("btn" + a);
        this.getField(b).buttonSetCaption("");
    var txt0 = this.getField("t0");
    var txt1 = this.getField("t1");
    var txt2 = this.getField("t2");
    var txt3 = this.getField("t3");
    var txt4 = this.getField("t4");
    var rxArray = [txt0.value, txt1.value, txt2.value, txt3.value, txt4.value];
    for(var m = rxArray.length - 1; m > -1; m--){
        if(rxArray[m] == ""){
            rxArray.splice(m, 1);
    rxArray.sort();
    var newArray = [txt0, txt1, txt2, txt3, txt4];
    for(var n = newArray.length - 1; n > -1; n--){
        if(newArray[n].value == ""){
            newArray.splice(n, 1);
    for (var i = 0; i < rxArray.length; i++) {
        var b = ("btn" + i);
        this.getField(b).buttonSetCaption(rxArray[i]);
        for (var x = 0; x < newArray.length; x++) {
            if(rxArray[i] == newArray[x].value){
                var s = ("this.getField('" + newArray[x].name + "').setFocus();");
                this.getField(b).setAction("MouseUp", s);
    //end
    function sortNumber() {
    var txt0 = this.getField("t0");
    var txt1 = this.getField("t1");
    var txt2 = this.getField("t2");
    var txt3 = this.getField("t3");
    var txt4 = this.getField("t4");
    var newArray = [txt0, txt1, txt2, txt3, txt4];
    for (var x = 0; x < newArray.length; x++) {
        var b = ("btn" + x);
        this.getField(b).buttonSetCaption(newArray[x].value);
        var s = ("this.getField('" + newArray[x].name + "').setFocus();");
        this.getField(b).setAction("MouseUp", s);
    //end
    As you can see, I've used the array lengths rather than fixed numbers, except when clearing the button values. I use a number there because there is no array to reference and didn't feel like making an array just for that. The number of buttons won't change.
    I've also added in a splice() method to remove the blank entries from my arrays when appropriate (making using the array length even more important).
    The result of the sort is:
    The only quirk I've found in all this is with the Add New button, which calls function addNew, which is:
    function addNew() {
    var txt0 = this.getField("t0");
    var txt1 = this.getField("t1");
    var txt2 = this.getField("t2");
    var txt3 = this.getField("t3");
    var txt4 = this.getField("t4");
    var newArray = [txt0, txt1, txt2, txt3, txt4];
    for (var i =  newArray.length - 1; i > -1 ; i--) {
        if (newArray[i].value == "") {
            newArray[i].setFocus();
    //end
    For this, I would have though that running through the array from start to finish looking for the first empty text field and setting the focus to it would have been correct. But that resulted in the last empty text field being focused. So I reversed the for loop to run finish to start, and the result was that the first empty field was focused. Not sure why that is...

  • ?Simple - array problems?

    Hey..
    This is a simple question, but I have one number that I want to find in an
    array of numbers. However, every time I close LABVIEW and reopen the
    VI, the array reinitialises to something other than what I originally set
    it to.
    Easy I know, but very confusing...
    Thanks Amie

    Thanks. I figured that one out the long way!!
    Roderic Don wrote:
    >"Kevin B. Kent" wrote>> amie wrote>>> >>> > array of numbers. However,
    every time I close LABVIEW and reopen the>> > VI, the array reinitialises
    to something other than what I originally set>>>> Right click on the array
    and select set current value to default>> then save the VI. It will always
    open with those values.>>>> Kevin Kent>>Make sure you right-click on the
    array INDEX and not one of the array elements>when you do this - it does
    make a difference!>>Rod>-->Roderic Don >Research Associate
    II>University of Delaware>Center for Composite Materials>302-831-8701>302-831-8525
    (FAX)>>

  • Troubled by simple array creation

    here is the code :
    public class Thing<T> {
         // Ok just wanted to check
         // does not compile (but specs says page 12 : should be unchecked WARNING!)
         //  T[] table = new T[25] ;
         // compiler says unchecked cast to type T !
         T[] table = (T[]) new Object[25] ;
    sorry : must be trivial but I do not get why the compiler (1.5.0) balks at new Object[x] ....
    is there a way to create an array of T?
    is that bad doctor?

    Why would you want to do that?
    private T[] table = new T[25];
    why not? (... though I admit it is not permitted by the spec
    so I bow out gracefully -BTW why is this absurd? is the compiler unable to generate appropriate code
    at compile time?)
    ok main point is about compiler still complaining at new Object[                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need Help with simple array program!

    Hi, I have just recently started how to use arrays[] in Java and I'm a bit confused and need help designing a program.
    What this program does, it reads in a range of letters specified by the user. The user then enters the letters (a, b or c) and stores these characters into an array, which the array's length is equal to the input range the user would enter at the start of the program. The program is then meant to find how many times (a,b and c) appears in the array and the Index it first appears at, then prints these results.
    Here is my Code for the program, hopefully this would make sense of what my program is suppose to do.
    import B102.*;
    class Letters
         static int GetSize()
              int size = 0;
              boolean err = true;
              while(err == true)
                   Screen.out.println("How Many Letters would you like to read in?");
                   size = Keybd.in.readInt();
                   err = Keybd.in.fail();
                   Keybd.in.clearError();
                   if(size <= 0)
                        err = true;
                        Screen.out.println("Invalid Input");
              return(size);
         static char[] ReadInput(int size)
              char input;
              char[] letter = new char[size];
              for(int start = 1; start <= size; start++)
                   System.out.println("Please enter a letter (a, b or c) ("+size+" max), enter # to stop:");
                   input = Keybd.in.readChar();
                   while((input != 'a') && (input != 'b') && (input != 'c') && (input != '#'))
                        Screen.out.println("Invalid Input");
                        System.out.println("Please enter a letter (a, b or c) ("+size+" max, enter # to stop:");
                        input = Keybd.in.readChar();
                                    while(input == '#')
                                                 start == size;
                                                 break;
                   for(int i = 0; i < letter.length; i++)
                        letter[i] = input;
              return(letter);
         static int CountA(char[] letter)
              int acount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'a')
                        acount++;
              return(acount);
         static int CountB(char[] letter)
              int bcount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'b')
                        bcount++;
              return(bcount);
         static int CountC(char[] letter)
              int ccount = 0;
              for(int i = 0; i < letter.length; i++)
                   if(letter[i] == 'c')
                        ccount++;
              return(ccount);
         static int SearchA(char[] letter)
              int ia;
              for(ia = 0; ia < letter.length; ia++)
                   if(letter[ia] == 'a')
                        return(ia);
              return(ia);
         static int SearchB(char[] letter)
              int ib;
              for(ib = 0; ib < letter.length; ib++)
                   if(letter[ib] == 'b')
                        return(ib);
              return(ib);
         static int SearchC(char[] letter)
              int ic;
              for(ic = 0; ic < letter.length; ic++)
                   if(letter[ic] == 'c')
                        return(ic);
              return(ic);
         static void PrintResult(char[] letter, int acount, int bcount, int ccount, int ia, int ib, int ic)
              if(ia <= 1)
                   System.out.println("There are "+acount+" a's found, first appearing at index "+ia);
              else
                   System.out.println("There are no a's found");
              if(ib <= 1)
                   System.out.println("There are "+bcount+" b's found, first appearing at index "+ib);
              else
                   System.out.println("There are no b's found");
              if(ic <= 1)
                   System.out.println("There are "+ccount+" c's found, first appearing at index "+ic);
              else
                   System.out.println("There are no c's found");
              return;
         public static void main(String args[])
              int size;
              char[] letter;
              int acount;
              int bcount;
              int ccount;
              int ia;
              int ib;
              int ic;
              size = GetSize();
              letter = ReadInput(size);
              acount = CountA(letter);
              bcount = CountB(letter);
              ccount = CountC(letter);
              ia = SearchA(letter);
              ib = SearchB(letter);
              ic = SearchC(letter);
              PrintResult(letter, acount, bcount, ccount, ia, ib, ic);
              return;
    }     Some errors i get with my program are:
    When reading in the letters to store into the array, I get the last letter I entered placed into the entire array. Also I believe my code to find the Index is incorrect.
    Example Testing: How many letters would you like to read? 3
    Enter letter (a, b or c) (# to quit): a
    Enter letter (a, b or c) (# to quit): b
    Enter letter (a, b or c) (# to quit): c
    It prints "There are no a's'" (there should be 1 a at index 0)
    "There are no b's" (there should be 1 b at index 1)
    and "There are 3 c's, first appearing at index 0" ( there should be 1 c at index 2)
    The last thing is that my code for when the user enters "#" that the input of letters would stop and the program would then continue over to the counting and searching part for the letters, my I believe is correct but I get the same problem as stated above where the program takes the character "#" and stores it into the entire array.
    Example Testing:How many letters would you like to read? 3
    Enter letter (a, b or c) (# to quit): a
    Enter letter (a, b or c) (# to quit): #
    It prints "There are no a's'" (should have been 1 a at index 0)
    "There are no b's"
    and "There are no c's"
    Can someone please help me??? or does anyone have a program simular to this they have done and would'nt mind showing me how it works?
    Thanks
    lou87.

    Without thinking too much...something like this
    for(int start = 0; start < size; start++) {
                System.out.println("Please enter a letter (a, b or c) ("+size+" max), enter # to stop:");
                input = Keybd.in.readChar();
                while((input != 'a') && (input != 'b') && (input != 'c') && (input != '#')) {
                    Screen.out.println("Invalid Input");
                    System.out.println("Please enter a letter (a, b or c) ("+size+" max, enter # to stop:");
                    input = Keybd.in.readChar();
                if(input == '#') {
                        break;
                letter[start] = input;
            }you dont even need to do start = size; coz with the break you go out of the for loop.

  • Simple array program help

    Hello could I please have some hints as to how to get this program working e.g. would it better to use a while loop for this? and how would I make the program stop when it has read 100 names?
    cheers anyone
    import java.util.*;
    import java.io.*;
    * The problem with files is generally you don`t know how many values
    * are in there. Develop a program to read names from a file - it carries
    * on and reads names until either 100 is reached or there is no more
    * data in the file. Display all the names read in together with the
    * count of how many names have been read.
    class Names100
         public void process (String[] argStrings)throws Exception
              int namesRead = 0;
              Scanner sc = new Scanner(new File("names.txt"));
              String[] namesArray = new String[100];
              for(int i = 0; i <= 100; i++)
                   namesArray[i] = sc.next();
                   System.out.println(namesArray);
                   namesRead++;
              System.out.println();
              System.out.println("Names read: " + namesRead);
              sc.close();

    > Thanks, the way that I have been taught at UNI means
    that I have a separate file called names100App (this
    is used to run the program).
    Ok, I understand.
    > The scanner is to get
    the content of the file although I could have used
    other things I guess.
    Yes, but the Scanner class is mighty handy.
    > Also I will check out what you said.
    >
    cheers
    John
    Good, and while you're at it, take a look at the ArrayList class (resizable-array implementation):
    http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html
    Good luck.

  • Simple Array and Concat Issue...

    my problem shouldn't be to terribly difficult to resolve, however it might be a little rough to explain. I am having an issue using the concat feature...
    I want to join 2 arrays, I assume you can use concat for this right?
    This is my goal...
    I am dynamically adding objects to my mx:List box. I want to be able to submit this list of objects to another mx:List box and when I add elements to the first list box, i want to again add them into the second list box without erasing the results that we first added...
    That probably doens't make much sense... I know. But I am just wanting to combine 2 arrays...
    How do I get the elements of a Mx:List into an array? would it be MyListBox.data ?? or MyListBox.DataProvider.???
    Any advice and help would be appreciated.

    dataProvider will be the one, but remember that once you set a dataProvider if it's an array it gets converted into an ArrayCollection.

  • Simple Array function

    Does anyone know why the, following code won't compile? It keeps coming up the the error message "<identifier expected>" in line one.
    import.java.util.*;
    public class SimpleArray
         public static void main(String[] args)
             SimpleArray s = new SimpleArray();
             s.run();
         public void run()
             //an array of 10 integers
             int[] array1 = new int[10];
             // directly fill the array
             array1 [0] = 2;
             array1 [1] = 4;
             array1 [2] = 6;
             array1 [3] = 8;
             array1 [4] = 10;
             array1 [5] = 12;
             array1 [6] = 14;
             array1 [7] = 16;
             array1 [8] = 18;
             array1 [9] = 20;
             // display the contents
             System.out.println("First time:");
             for (int i = 0; i< 10; i++)
                 System.out.println(i + ": " + array1);
         // reuse the array reference
         array1 = new int[10];
         // fill the array in a for loop
         for (int i = 0; i < 10; i++)
         array[i] = i * 3;
         // display the contents
         System.out.println("\nSecond time:");
         for ( int i = 0; i < 10; i++ )
         System.out.println(i + ": " + array1[i]);
         [\code]

    I hope I'm not spoiling anything, but I've noticed that you use
    // fill the array in a for loop
    for (int i = 0; i < 10; i++)
    array = i * 3;
    } You have some variable called array. Do you mean to say array1?

  • Help with a simple array.

    Hey guys. I'm a bit of a noob here, and I'm sure you can fix up my problem real quick. Ok, I'm trying to make an array where, after you enter some integers, will automatically rearrange those integers from smallest to largest for you and print them back out to the screen. Here's my code:
    import cs1.Keyboard;
    public class Array2
         public static void main (String[] args)
              int num;
              int count=0, step=1;
              System.out.println("Enter the length of the array");
              int arraylength = Keyboard.readInt();
              int[]Array = new int[arraylength];
              System.out.println("Enter the first value in the array:");
              Array[0] = Keyboard.readInt();
              while(count<arraylength-1)
                   System.out.println("Enter the next value in the array:");
                   num = Keyboard.readInt();
                   if(num>Array[count])
                        Array[count+1]=num;
                        count++;
                   else
                        for (int count2=count; 0 <= count2; count2--)
                             Array[count2]=Array[count2+1];
                             num = Array[count2];
                   count++;
              for(int outputcount=0; outputcount<arraylength; outputcount++)
                   System.out.print(Array[outputcount] + " ");
    }

    An assignment is yours to learn from, not ours to write for you. Try doing some debugging of the program - use System.out.println() statements to print values of various program variables and to see what the program is doing. If you get to a point that you can't solve a specific problem, then post a specific question and example of the problem. (So far, all you've done is said "the program doesn't work")

  • Help with simple array program

    my program compiles and runs but when after i enter in 0 it says that the total cost is 0.0 any help would be great thanks
    /**Write a program that asks the user for the price and quantity of up to 10 items. The program accepts input until the user enters a price of 0. 
    *The program applies a 7% sales tax and prints the total cost.
    Sample
    Enter price 1:
    1.95
    Enter quantity 1:
    2
    Enter price 2:
    5.00
    Enter quantity 2:
    1
    Enter price 3:
    0
    Your total with tax is 9.52
    import java.util.*;
    public class Cashregister
    static Scanner input = new Scanner(System.in);
    static double userinput = 1;
    public static void main(String[] args)
      int anykey;
      int howmanyproducts;
      System.out.println("This Program will allow you to enter the price and quanity of a set of items until you press zero, and after you press zero it will put the tax on it and give you the subtotal.");
      int whichproduct = 1;//used to say what
      int whichquanity = 1;
      double beforetax = 0;
      double aftertax = 0;
      double [] finalproduct = new double [9];
      double [] finalquant = new double[9];
      double [] finalanswer = new double[9];
      double taxrate = .07;
      int index = 0;
      while(userinput !=0)
       System.out.println("Enter price " + whichproduct + ":");
       userinput = input.nextDouble();
       whichproduct ++;
       if(userinput != 0)
       finalproduct[index] = userinput;
       System.out.println("Enter quanity " + whichquanity + ":");
       userinput = input.nextInt();
       finalquant[index] = userinput;
       whichquanity ++;
       index ++;
      else
      int [] indecies = new int [index];//used for array.length purposes
       for(int j = 0; j<indecies.length; j++)
         finalanswer[index] = finalproduct[index] * finalquant[index];
      for(int k = 0; k < indecies.length; k++)
         finalanswer[k] = finalanswer[k] + finalanswer[k];
         beforetax = finalanswer[k];
         aftertax = beforetax * taxrate;
      System.out.println("The total cost with tax will be $" + aftertax);
    }

    I tried ot indent better so it is more readable and i removed the tax out of my loop along with another thing i knew wasnt supposed to be their. Ran it again and i still got the same total coast = 0.0
    import java.util.*;
    public class Cashregister
    static Scanner input = new Scanner(System.in);
    static double userinput = 1;
    public static void main(String[] args)
      int anykey;
      int howmanyproducts;
      System.out.println("This Program will allow you to enter the price and quanity of a set of items until you press zero, and after you press zero it will put the tax on it and give you the subtotal.");
      int whichproduct = 1;
      int whichquanity = 1;
      double beforetax = 0;
      double aftertax = 0;
      double [] finalproduct = new double [9];
      double [] finalquant = new double[9];
      double [] finalanswer = new double[9];
      double taxrate = .07;
      int index = 0;
      while(userinput !=0)
       System.out.println("Enter price " + whichproduct + ":");
       userinput = input.nextDouble();
       whichproduct ++;
            if(userinput != 0)
                    finalproduct[index] = userinput;
                    System.out.println("Enter quanity " + whichquanity + ":");
                    userinput = input.nextInt();
                    finalquant[index] = userinput;
                    whichquanity ++;
                    index ++;
            else
                    int [] indecies = new int [index];
                    for(int j = 0; j<indecies.length; j++)
                            finalanswer[index] = finalproduct[index] * finalquant[index];
                    for(int k = 0; k < indecies.length; k++)
                           finalanswer[0] = finalanswer[k] + finalanswer[k];
                    beforetax = finalanswer[0];
                    aftertax = beforetax * taxrate;
                    System.out.println("The total cost with tax will be $" + aftertax);
    }

  • Simple Array Question - Help Needed!

    Hey people,
    I need a line of code that gets the maximum value out of an array.
    the array is called LEVELS and contains values [1, 3, 4, 17, 3, 2, 4]. I need a line of code that creates a new variable called MAXLEVEL and finds the largest value within the array.
    Thanks,
    sean :)

    Create a variable. Initialize it to the lowest possible value, like say Integer.MIN_VALUE.
    Loop through your array.
    For each element, see if it's greater than the current value in the variable. If it is, use it.
    When you reach the end of the array, the variable now holds the max value.
    How did you think you were going to do it?

  • What am I doing wrong with this simple array?

    I have an array that I need to add single characters to slowly.
    So the array is wordToCheck and I have some "drop places" to check and see if a letter has been "dropped off." Each drop point is assigned an index and I just want to add the letter to the proper index of the array so that I can push it into a string.
    This is my code:
    wordToCheck[currentBlank.register] = currentLetter.letter.toLowerCase();
    So you can see that if "A" was dropped at the blank spot with the register 2 it would return "- - A".
    The problem is that it's deleting it every time I add a letter. So if I put "A" in register 2 and then "M" in register 3 it returns "- - - M".
    How do I get it to not override itself each time?

    I tried making it an object but I guess I'm confused how that is supposed to work.
    When I tried to parse my array to a string it had a bunch of ","'s in it. So if I got it to be myArray["a" "b" "c"] it returns the string "a,b,c" instead of "abc."
    Why is that? Would using an object fix it? How is using an object different than using an array?
    I've read dozens of forums on this and I just can't figure out the difference except that in an object you are allowed to use a letter as the reference instead of a number.

  • Simple Array Dimensioning question

    Hey all,
    What is the easiest way to dynamically set the array dimension of an array? I have a method that returns an object array of type Project. The array size of the returned object varries depending on what parameters are passed. I do not know how to declare the object that calls the method. Can you help me? Thanks.
    DetailedProject[] test = new DetailedProject[5];
    test = myBudgetDAO.getProjects("2006","O&M","25","109","98");

    Would I still be able to call the same method with different parameters? Yes. All you say is that the method is returning an array.
    The size of the array matters not to your main program, just that the method returns an array of the appropriate objects.
    Something in your getProjects method you must be declaring/creating an array. Look at that code.
    The getProjects method must know how many to create if it is returning the correctly sized array.
    An alternative is instead of using an array, to use a List (eg ArrayList) which dynamically resizes itself, and you don't need to set inital capacity.

Maybe you are looking for

  • Please explain how the method CHECK_CHANGED_DATA works?

    Hi experts,    Can any of you experts please explain how the method <b>CHECK_CHANGED_DATA</b> of <b>CL_GUI_ALV_GRID</b> class works ? Thanks in advance regards, Ashwin

  • How can I have both date and time for a Date type variable?

    If I have a Date type variable: Date today=new Date(), Is it possible to also give the current time to "today" but still keep the type as Date? I mean , for exmaple I want to store this "today" to database as Date type, and the value in database is "

  • Vendor not coming in RFQ from PR

    Hi, I created PR, and i checked source determination and i got fixed vendor in PR from source list... Now while creating RFQ wrt above PR, i am getting entire details along with vendor...Now after clicking adopt + details, i can see all details of PR

  • Email/Fax/Print

    Hi Gurus, My client want to send the PO by email, it it fails- send by fax, if it also fails- send to vendor by taking print of this PO. I know how to get  print . Also get the info about sending fax or sending by email. but how to fulfill above requ

  • Oracle upgrade fails with ODMA_RBS error

    Hi all, I am trying to upgrade Oracle 8.1.7 to Oracle 9.2 using database upgrade assistant and while doing that I am getting error at final Step 4 after clicking the Finish button error msg is "90MB of Free disk space not available at F:\ORANT9\orada