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...
Type: Posts; User: Tokugawa
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...
/*
* 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...
I dont know why I didnt print something.
public class DAOTextImpl implements DAOInterface {
private ArrayList<YearData>yeardata;
static final char DELIMITER=',';
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...
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...
Would it be easier if Just start from scratch?
--- Update ---
It doesn't output/appear
debug:
Weather App
===========
Load an existing File (Y/N)?:
y
Enter filename:
tony2
/*
* 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...
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...
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[]
package repositories;
import java.util.ArrayList;
import java.util.function.Predicate;
import model.City;
public class Repository implements RepositoryInterface {
private...
package repositories;
import java.util.ArrayList;
import java.util.function.Predicate;
import model.City;
public class Repository implements RepositoryInterface {
private...
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
Would that be the same process as before ?
In truth, there are so many files...I am not sure where the hell the problem is :(
City
https://pastebin.com/unNWPQFf
YearData
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...
package repositories;
import daos.DAOTextImpl;
import java.util.ArrayList;
import java.util.function.Predicate;
import model.City;
public class Repository implements RepositoryInterface {...
How exactly did you place that code?
static class City {
}
public static void main(String[] args) {
Repository rep = new Repository();
rep.add(new City());
...
https://pastebin.com/GWGs0phe
Hi guys,
The following is a silly program I made.
https://pastebin.com/GWGs0phe
It covers:
I have no idea how to check the add method. It is a void method.
/*
* 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...
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,...
package repositories;
import daos.DAOTextImpl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Predicate;
import model.City;
public class Repository...
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...
Hint: Modulus operator...