Search:

Type: Posts; User: ProgrammerNoobE

Page 1 of 2 1 2

Search: Search took 0.13 seconds.

  1. Re: When I run my program, it says error: java.lang.NullPointerException

    To change it all to boolean takes to long. there is only one error left. an out of bounderies error, could you see it?

    code:

    import java.util.*;
    import java.io.*;

    class GameOfLife{ // main...
  2. Pleas help! array index out of bouderies

    When I execute my program it gives an error :

    java.lang.ArrayIndexOutOfBoundsException: 6
    at Field.numNeighbours(GameOfLife.java:131)
    at Field.generationNextCalc(GameOfLife.java:164)
    at...
  3. Re: When I run my program, it says error: java.lang.NullPointerException

    Thank you again!

    I think I'm almost there, just have my doubts about the output

    My recent code:



    import java.util.*;
    import java.io.*;
  4. Re: When I run my program, it says error: java.lang.NullPointerException

    My new code:




    import java.util.*;
    import java.io.*;

    class GameOfLife{ // main class
    Field field = new Field();
  5. Re: When I run my program, it says error: java.lang.NullPointerException

    It reads the file
    Then calculates the number of rows(lines)
    I added 2, because I want to make a border around it
  6. When I run my program, it says error: java.lang.NullPointerException

    I tried to write a program such as the game of life, but without the sourcecode of the game of life. Just with the things I learned so far.

    It is not quit clean, but when it works it is fine to...
  7. Re: When I run my program, it says error: java.lang.NullPointerException

    Stupid of me! scanner = new Scanner (System.in);

    Thank you!
  8. Re: When I run my program, it says error: java.lang.NullPointerException

    Thank you for your fast reply!

    I tried to locate it, but I just don't see it. Only in this class the variabel numberOfGenerations is used and it is initialized just before the user is asked for...
  9. When I run my program, it says error: java.lang.NullPointerException

    Hello,

    I need some help, because I just don't see it!

    This is my code:



    class GameOfLife{ // main class
    Field field = new Field();
  10. Replies
    4
    Views
    229

    Re: Several questions about my code

    Thank you for your clear explanation! But I have still 1 question, how do I add a new account with a name which is entered by the user and an initial balance of 0? I want to do that in the enroll...
  11. Replies
    4
    Views
    229

    Re: Several questions about my code

    I don't understand you. I'm a beginner in Java, so I'm not familiair with everything. How do I define the accounts.equals in my Account class? And do you know why my accound.add(account); doesn't...
  12. Replies
    4
    Views
    229

    Several questions about my code

    Hello,

    The comments in the code are my specified questions about the code. Please help me with finding the proper solution. I searched on the web, but I did not find the right solution for my...
  13. Replies
    9
    Views
    275

    Re: What is wrong with my ArrayList?

    I understand what you say, but I just don't know how it works, could you give me a hint?

    what I have right now:


    void enroll(String name){
    if(account.equals(account)){
    ...
  14. Replies
    9
    Views
    275

    Re: What is wrong with my ArrayList?

    I don't know what you mean. Could you explain it with an example? I'm not so familiair with english terms, because I'm from Holland.
  15. Replies
    9
    Views
    275

    Re: What is wrong with my ArrayList?

    [/COLOR]Your ArrayList holds accounts. Why are you passing a String into the contains() method?[/QUOTE]

    I've put name in it, because when the user types a command like enroll "name" it should only...
  16. Replies
    9
    Views
    275

    Re: What is wrong with my ArrayList?

    My program looks now like this:



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

    class Bank{
    double balance;
    //Account account;
  17. Re: Could somebody help me with my homework? Calling method's from another class

    Thank you PhHein,

    Am I in the right direction now?



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

    class Bank{
  18. Replies
    9
    Views
    275

    What is wrong with my ArrayList?

    Pleas help me!

    I have a problem with my ArrayList, I don't understand how the user input should be stored in the ArrayList and how I can print the ArrayList

    my code:


    import...
  19. Re: Could somebody help me with my homework? Calling method's from another class

    Thank you very much, I searched in the coursereader for information about arraylists, but what I don't understand is how I have to print the accounts?



    import java.util.Scanner;
    import...
  20. Re: Could somebody help me with my homework? Calling method's from another class

    I also tried it with this code:



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

    class Bank{
    double balance;
    //Account account;
  21. Re: Could somebody help me with my homework? Calling method's from another class

    Thank you very much, it is working better now!

    Now I'm stuck on the array part. I don't really understand arrays and now I have to make a print of multiple accounts of people. How do I have to do...
  22. Re: Could somebody help me with my homework? Calling method's from another class

    Hello PhHein,
    Thank you for your fast replies!

    Could you explain it a little bit more, I'm a dutch student and I'm not really good with English terms so maybe you could explain it with some...
  23. Re: Could somebody help me with my homework? Calling method's from another class

    sorry for this mistake, I've changed it now
  24. Re: Could somebody help me with my homework? Calling method's from another class

    This is the code I have so far, but it does not work :( I think I choose the wrong constructor, because in the assignment stands that the class Bank should be the main class, so that should be the...
  25. Could somebody help me with my homework? Calling method's from another class

    4 Banking

    You are going to build a simple system of bank accounts. The program reads commands from input and executes them on the accounts (such as withdrawals, deposits, enrolling of new...
Results 1 to 25 of 26
Page 1 of 2 1 2