Search:

Type: Posts; User: Tokugawa

Page 1 of 2 1 2

Search: Search took 0.07 seconds.

  1. Replies
    1
    Views
    2,773

    Difficulty adding to collection?

    I think I have worded my title clumsily, as I am not 100% sure best way to identify my problem, so bear with me.


    I am trying to alter my code so that I can use a user supplied city id value to...
  2. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */
    package...
  3. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    I dont know why I didnt print something.



    public class DAOTextImpl implements DAOInterface {
    private ArrayList<YearData>yeardata;

    static final char DELIMITER=',';
  4. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    Where is the code for the add method that is called in the load method?
    There isn't any.

    Do you mean the printout statement?

    That was in the repository class, not the class which has the load...
  5. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    There is a print statement in the add method, and the toString method. Only the toString method actually returned a value. The printout of the add method doesn't show/doesn't exist, as I've stated...
  6. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    Would it be easier if Just start from scratch?

    --- Update ---

    It doesn't output/appear
  7. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    debug:
    Weather App
    ===========


    Load an existing File (Y/N)?:
    y
    Enter filename:
    tony2
  8. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */
    package...
  9. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    System.out.println("value of repository is"+repository); that is no longer appearing, whether I load a file or not.

    System.out.println("value of items in the add method is:"+items); that appears...
  10. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    I have to compile the whole project, because that file does not have a main method. The project runs, and I get:


    items []
    value of items in the toString method is[]
  11. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    package repositories;

    import java.util.ArrayList;
    import java.util.function.Predicate;
    import model.City;


    public class Repository implements RepositoryInterface {
    private...
  12. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    package repositories;

    import java.util.ArrayList;
    import java.util.function.Predicate;
    import model.City;


    public class Repository implements RepositoryInterface {
    private...
  13. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    I dont understand. They are void methods, even including a system.out.println statement in them doesn't generate anything. I create a main method, attempt to invoke the method, can't do so
  14. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    Would that be the same process as before ?
  15. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    In truth, there are so many files...I am not sure where the hell the problem is :(




    City

    https://pastebin.com/unNWPQFf

    YearData
  16. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    Finally! I got the same results as you.

    Items: [repositories.Repository$City@53e25b76, repositories.Repository$City@73a8dfcc, repositories.Repository$City@ea30797]

    So that to me, seems like...
  17. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    package repositories;

    import daos.DAOTextImpl;
    import java.util.ArrayList;
    import java.util.function.Predicate;
    import model.City;


    public class Repository implements RepositoryInterface {...
  18. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    How exactly did you place that code?


    static class City {
    }

    public static void main(String[] args) {
    Repository rep = new Repository();
    rep.add(new City());
    ...
  19. Replies
    1
    Views
    3,215

    OOP tutorials (I made)

    https://pastebin.com/GWGs0phe

    Hi guys,

    The following is a silly program I made.

    https://pastebin.com/GWGs0phe

    It covers:
  20. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    I have no idea how to check the add method. It is a void method.
  21. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file, choose Tools | Templates
    * and open the template in the editor.
    */
    package...
  22. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    Not 100% sure how I would do that?

    So far, created a new class,




    /*
    * To change this license header, choose License Headers in Project Properties.
    * To change this template file,...
  23. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    package repositories;

    import daos.DAOTextImpl;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.function.Predicate;
    import model.City;


    public class Repository...
  24. Re: Difficulty in creating/writing to a file (also, with reading file with data)

    The problem is that I am being asked to do this with seperation of concern in mind, and with a MVC architecture which is complicating things.

    I am not sure how I would implement what you...
  25. Replies
    22
    Views
    865

    Re: Between 100 and 200.

    Hint: Modulus operator...
Results 1 to 25 of 28
Page 1 of 2 1 2