Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
| Search | Today's Posts | Mark Forums Read
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 20th, 2003, 08:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default Vector.contains(Object obj)

I am pretty new to Java, and I am trying to use contains to check if an object is contained in some Vector. I am storing my own object in the Vector.

I though that it could be because I didn't implement the equals method, however I tried that in the class and it didn't help. What should I do to make it work!?

It is not only contains, it is also methods such as removeElement, which also take and Object as parameter.

Hope you can help, thanks in advance.

Jacob.
__________________
Danish audio books for download at http://www.lytenbog.dk (Danske lydbøger til download).
 
Old December 20th, 2003, 08:40 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I figured it out! I used my own type as argument in the implementation, and not Object. Jacob.
 
Old January 10th, 2004, 02:34 PM
Registered User
 
Join Date: Jan 2004
Location: Chennai, tamilnadu, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hy I got 2 do my project in EJB, JSP & other Java stuffs.. I know only basics in JAVA...

How to step into the project

Regards
Karthik




Similar Threads
Thread Thread Starter Forum Replies Last Post
Object refrence not set to an instance of an obj viral648 ASP.NET 1.0 and 1.1 Professional 1 January 2nd, 2007 01:11 PM
Object reference not set to an instance of an obj nrathod_97 BOOK: Beginning VB.NET Databases 4 June 21st, 2005 06:35 PM
Object reference not set to an instance of an obj. Dwizz VB.NET 2002/2003 Basics 8 June 1st, 2005 08:28 AM
vector.add(); -- Reference or Object? Firedawn Servlets 2 February 23rd, 2005 01:04 AM
vector.add(); chikodi Servlets 2 October 23rd, 2003 02:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.