Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

SeigiroSpica

Member
  • Content Count

    8
  • Joined

  • Last visited

Awards


This user doesn't have any awards

About SeigiroSpica

  • Title
    Newbie
  1. SeigiroSpica

    Java array phonebook problem

    Perfect. Now I get it. And finally got it right. Thank you both! You were really helpful!! This is how the method looks now public boolean existeContacto(Contacto c){ boolean existe= false; for (int i=0;i<persona.length;i++){ if (persona[i]!=null && persona [i].getNombre().equals(c.getNombre())){ existe=true; } } return existe; } I need it to go throught the whole list cuz I need it to either find a existing contact with the same name to send an error message to the user or to send a false to another method to seach for null objects o add the new contact in the phonebook list I finally understand better this, and got it to work better Again, thank you both very much for your help, @Franck @Sauron
  2. SeigiroSpica

    Java array phonebook problem

    Thank you very much @Sauron and @Franck for the help with my homework, it's still kinda hard for me but I got the code to work, at least to make existeContracto(Contacto c) work, I tried to break it, wasn't able yet, so i think i'm ready to keep going with the rest of the code. At first I did what @Sauron told me buy it kept returning the same error of null pointer So I tried something with all you guys explained to me uptil now, and it worked. This is the fix that I did, I don't know if it's perfect or the best, but public boolean existeContacto(Contacto c){ for (int i=0;i<persona.length;i++){ if (persona[i]==null){ return false; } else { if (persona [i].getNombre().equals(c.getNombre())){ return true; } } } return false; } So the first if checks for the null if it's null, then sends a false to addContacto, so it can add the new contact if it sends true, checks if the contact has the same name, and if it is it sends the message "You can't add the same contact" I think the last false is kinda redundant but if I take it out it breaks everything, so... But for the rest it works fine
  3. SeigiroSpica

    Java array phonebook problem

    @Franck @Sauron thank you very much both. I did what you recommended me, I did first what Franck I got the code to work puttin the creation of Contacto inside the case 1 everthing work fine then I went to test if I get the error "This contact already exist" from ExisteContacto(Contacto) I didn't get that message, so I then proceedd to try and fix the error that Sauron explained going from: if (c.equals(persona[i]) ) { return true; } //(This was always true since C was a new contacto in the main every time the user tries to add a new contact as i understand it) to: if (c.getNombre().equals(persona[i].getNombre())) {return true;} I wanted to get the names to compare but this just break the code the moment it hits the "If", i think it has to do with something in the array persona when it tries to grab the name that it set as null. Or maybe the whole persona is the problem since it's null, but with the equals doesn't seem to have a problem with that... I think I still don't understand objects or arrays very well, because I can't see what the problem is...
  4. SeigiroSpica

    Java array phonebook problem

    Okay, i'm trying to do a phonebook I have the main (AdC), the class of the phonebook (Agenda) where all the methods are in, and a class for the contacts (Contacto) with their phone number and name. What i'm trying to do in the main is to add a new contact with the option 1 using the method addContacto(Contacto c). I can add the first contact with no problem. I can show it with the option 5 that use the method listarContacto(). But when I try to add a second contact with the class addContacto(Contacto c) for some reason when is checking if the "new" contact already exist with the method existeContacto(Contacto C) even tho I type a different name and phone number it responds that the contact exist and that I can't add a new contact. And at the same time replaces the first contact that I added with the second one, even tho it told it shouldn't since responded that I can't add in the condition "If" of existeContacto(). I don't know what the problem is and is taking me hours already... I can't see it or I don't understand something basic....
  5. SeigiroSpica

    Java constructor problem

    omg... thank you very much, I'm looking at the code since last night and I couldn't figure it out, thank you @Mira Yurizaki
  6. SeigiroSpica

    Java constructor problem

    Hello, I'm needing a bit of help with a bit of homework that I'm doing I did the class and the constructor. but when I try to call it in the main code, it says that error. And I can't see what I'm doing wrong.
  7. SeigiroSpica

    [Help] Back up drivers and fresh install

    Ohhh, okay, thank you very much for helping me @TheDelphiDude and @homeap5 It seems that what I knew was wrong haha Oh well Thank you for the answer of the drivers, also! Do you recommend to install Win 10 32bits still or should I stay in Win 7?
  8. SeigiroSpica

    [Help] Back up drivers and fresh install

    Hello,this is my first post so I hope that I'm posting it in the right place. I want to back up the drivers of an old netbook that the goverment gave us students here (a Nobelx NT1010E) The Netbook has windows 7 32 bits and a partition of ubuntu that I never used. A Intel Atom N2600 and 2gb RAM, That I want to upgrade to 4. Idk if I can add it more. I thought about using DriverBackup 2! or DriverGuide Toolkit to back up all the drivers, since some of the drivers I don't whing I would be able to find online, like the touchpad, and others. But I like to upgrade to windows 10 64 bits, since I read I could by getting 2gb more RAM. Also since in LTT they said that Win 7 is diying, I thought that I should do it now, so I don't have to do it again. Well, My question is, if I back up my drivers from W7 32 bits, Can I restore them in the fresh W10 64bits install without a problem? Thank you very much for reading, sorry if my english is not the best, I hope you can help me or give me some advices or tips.
×