Search:

Type: Posts; User: dboxall123

Search: Search took 0.10 seconds.

  1. Replies
    4
    Views
    1,015

    Re: Odd behaviour in map of coordinates

    OK great, thank for your help
  2. Replies
    4
    Views
    1,015

    Re: Odd behaviour in map of coordinates

    I think i get it. Is this kind of like in C, where if say you send an array to a function, you're actually sending a pointer to the memory location of the first element? And when I assigned the array...
  3. Replies
    4
    Views
    1,015

    Odd behaviour in map of coordinates

    Hi,
    I have a HashMap<Character, int[]> full of coordinates of letters in 5x5 table (char[5][5]), which I'm using for a cipher program I'm writing. Basically in order to encode each letter I take the...
  4. Re: Can an int array contain a short or byte?

    Are there actually any moderators on this site? If so, why don't they delete the " Buy Registered and Unregistered Swiss, Austrian passports + id cards" posts that keep appearing daily lol?
  5. Thread: loop

    by dboxall123
    Replies
    13
    Views
    784

    Re: loop

    Wage and wages were obviously just examples. And no, that wasn't what I meant. The exercise asks for an 'array of counters'. So, I think you need to set up an array, and each item of the array is set...
  6. Thread: loop

    by dboxall123
    Replies
    13
    Views
    784

    Re: loop

    Right, so I think that the assignment is asking you to create an array to hold the count of each salary range, so you would need to create a second array, let's call it amountsPaid. The size of...
  7. Thread: loop

    by dboxall123
    Replies
    13
    Views
    784

    Re: loop

    So you don't have to do any of the math, right? You just have an array of integers? So, for example,



    int twoHundredTo299 = 0;
    int threeHundredTo399 = 0;

    for (int wage : wages) {
    if...
  8. Thread: loop

    by dboxall123
    Replies
    13
    Views
    784

    Re: loop

    Ah, I didn't realise that the second for loop was outside of the while loop, I was a bit confused by it.

    That's even easier, just create some integer variables, all set to zero. Then loop through...
  9. Thread: loop

    by dboxall123
    Replies
    13
    Views
    784

    Re: loop

    Well, if you fill the array up, until count < salesAmount.length, it should then exit the first for loop and move to the second, printing each item in the array. As for exiting the for loop when a...
  10. Replies
    2
    Views
    1,365

    Re: Confused about ActionListener syntax

    Great, I'll read up on anonymous classes and lambda expressions, thanks Jim
  11. Replies
    2
    Views
    1,365

    Confused about ActionListener syntax

    Hi,

    I'm going through java swing tutorials here, and there's a line I don't understand:


    JButton button = new JButton("Click me");

    button.addActionListener(new ActionListener() {
    public...
  12. Replies
    3
    Views
    882

    Re: array numbers

    For dynamically sized array, you could use ArrayList:


    import java.util.Scanner;
    import java.util.ArrayList;

    class MyArray {
    public static void main(String[] args) {
    ArrayList<Integer>...
  13. Thread: Hello!

    by dboxall123
    Replies
    0
    Views
    856

    Hello!

    Hi everyone

    Just thought I should introduce myself. I'm Dan, and I'm learning java from the Oracle Tutorials, which by the way, I'm finding really good, very detailed. I'm not joining this forum...
Results 1 to 13 of 13