koricha's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Active Members
Active Posts:
86 (0.09 per day)
Joined:
08-February 12
Profile Views:
1,560
Last Active:
User is offline Apr 14 2013 11:26 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   koricha has not set their status

Posts I've Made

  1. In Topic: vector add

    Posted 13 Dec 2012

    View Postpbl, on 13 December 2012 - 02:49 PM, said:

    Use a HasMap<String,String> for that

    And if you use a Vector make it a Vector<B>
    don't add an Object add a B
    than you can search the Vector to see if a B already contains str1 but has I have said, this is precisely to achieve what you are trying to do that HashMap were invented.


    Thank you pbl i didnt know this is possible, thank you it works great.
  2. In Topic: comparing vector to a string

    Posted 5 Dec 2012

    View Postg00se, on 05 December 2012 - 03:57 PM, said:

    Try
    System.out.println(obj.equals(((B)vec.get(i)).getStr()));
    


    Thank you works great :)
  3. In Topic: comparing vector to a string

    Posted 5 Dec 2012

    Quote

    This is the source of String.equals (which is the equals you're calling)
    Line 5 should give you clue as to why your code would never evaluate to true


    is is there a way to do this or its inpossible
  4. In Topic: Comparing vector elements

    Posted 4 Dec 2012

    thank you guys very helpful :)
  5. In Topic: Comparing vector elements

    Posted 2 Dec 2012

    i found a way to fix it, but why my first code didnt work

    	 public Object get(Object obj) {
    		 for (int i = 0; i < vec.size(); i++)
    	     {
    			 if(obj.equals(vec.get(i))){
    	            System.out.println("it exists");
    	            return obj;
    			 }
    			 
    	     }
    			return null;
    	}
    

My Information

Member Title:
D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Click here to e-mail me

Friends

koricha hasn't added any friends yet.

Comments

koricha has no profile comments yet. Why not say hello?