X-Received: by 10.224.19.78 with SMTP id z14mr2779492qaa.4.1361376567264; Wed, 20 Feb 2013 08:09:27 -0800 (PST) X-Received: by 10.49.35.77 with SMTP id f13mr1701925qej.4.1361376567236; Wed, 20 Feb 2013 08:09:27 -0800 (PST) Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!dd2no909132qab.0!news-out.google.com!t2ni2qaj.0!nntp.google.com!dd2no909124qab.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.java.programmer Date: Wed, 20 Feb 2013 08:09:27 -0800 (PST) In-Reply-To: <13ede5d6-5aa5-41b6-834e-330e5ae94000@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=173.164.137.214; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T NNTP-Posting-Host: 173.164.137.214 References: <13ede5d6-5aa5-41b6-834e-330e5ae94000@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <31934753-760f-4666-b9b5-233f155a129b@googlegroups.com> Subject: Re: how to access object of one class in another class From: Lew Injection-Date: Wed, 20 Feb 2013 16:09:27 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Lines: 25 Xref: csiph.com comp.lang.java.programmer:22391 xodepp shrestha wrote: > i [sic] am having problem in JDBC.there are two different class[es] withi= n same package name.one class is dbconnect and another is login. I need to = call the dbconnect class within login class and i [sic] need to call the co= nnection object from the dbconnect class in the login class. You don't call classes in Java, you call methods. You don't call objects in Java, you call methods. What methods did you need to call? I'm betting you spelled those class names wrong. If you created those class= es,=20 then you failed to follow the Java naming conventions. Spelling is crucial in Java, and the conventions are important. Please provide an SSCCE. http://sscce.org/ Arved's right. You need to start from the beginning. There's a lot of=20 material available for free, just an online search away. --=20 Lew