doesnt matter know ive added a second print writer to do it and it works
Type: Posts; User: ajw1993
doesnt matter know ive added a second print writer to do it and it works
Im having trouble apprending a file which has to have a hash map plus have data before it. it only does one at a time
if(customerMap.size()> 0)
{
PrintWriter nw = new...
it has to be a hash map cz i will have to be able to get them later via the key. is there a way of doing it the way i want . n its not the map thats repeating its the other information.
i need one piece of data to write once , followed by all data in a hashmap with out no replacing of the data beause all the data append each other
well the data i want is in a map , but i need to have that in a loop to get them all , but have other data not repeat where it says ok i need that only once!
I need help on figuring out how to send data to a file without it replacing the data and also repeating other data. The code below doesnt replace any darta, but it repeats data that i want in there...
well u do a id by string followed by 6 random numbers then adds to the map . but how would u just add n not use it again
Im trying to store random id's in my code , but im trying to figure out how to store only unique id's how would i do that ?
public void storeCustomer (Customer newCustomer)
{
...
well the range is just between 0-9 , it depends on the parameter how many go into the string.
The code only stores what string is in the parameter n the first generated number
Hello
I need help on storing random generatored numbers into a string every time they get generated , im also to store the string i want , but not the amout of numbers that i select to be...
through the scanner in a different class in a method . and also in the sub class it reads in additional data
public void readData(Scanner scanner)
{
group = scanner.next();
...
nothing is being read in
there is data there though , all the vehicles have regNo's and its saying that on 112 that it cant find the regNo,.
java.util.NoSuchElementException
at java.util.Scanner.throwFor(Scanner.java:907)
at java.util.Scanner.next(Scanner.java:1416)
at Vehicle.readData(Vehicle.java:112)
at...
there should be 7 for the car , but it keeps coming up null and not storing anything and no it will follow a comment , blank lines then [Van data , then do the van data
yeah ino but how do i record it n use the result .
thats what the code is , thats why im confused
the deal code will create an object , read in the data and also store it in the array
else
{
Scanner scanner2 = new Scanner(lineOfText);
...
thats what i think should work , when looking at the psuedo code =
while ( there are more lines in the file)
{
lineoftext = nextline from scanner
if (line start with //)
{
ignore
}
else if...
there is no problem yet because i just wanted to get this bit right first and it is else if(lineOfText.startsWith("[")
just wondering what should i put
--- Update ---
there is no problem yet...
I have a ptoblem i have 3 types of data in one file for example car data , van data , truck data. The problem is i have to have a flag to check what data is next and set a variable , so we know what...
there is no problem i was just wondering how i would create a class that woould do it
yeah i get that but i have to do it in another classes constuctor in the test class. like below i have to create a vehicle object in the class below's constuctor n store it , but in the test class ?...
hey i need help on testing a class it is confusing me on how to do it i was wondering how would i do it.
i need to create 3 objects in another classes constuctor n store them in an arraylist
thank you man it works . can you do something else for me im just confused on how to write a test class on testing how to create 3 objects and adding them to an array list.