mardi 25 août 2015

Why it is null when I'm calling a get method of one class from another class using reference i.e it prints out null

I want to execute the getName() which contains the return method of name but it is printing out "null"

public void getAllVisits() 
   {
       Visit v = new Visit();
       for (int i = 0; i < myVisits.size(); i++)
       {
           System.out.println(v.getName());
           System.out.println(v.getAmount());
           System.out.println(v.getDate());
       }
   }



from Newest questions tagged java - Stack Overflow http://ift.tt/1IcYmxi
via IFTTT

Aucun commentaire:

Enregistrer un commentaire