Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #22384 > unrolled thread

how to access object of one class in another class

Started byxodepp shrestha <xodepp@gmail.com>
First post2013-02-20 00:04 -0800
Last post2013-02-20 08:09 -0800
Articles 4 — 4 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  how to access object of one class in another class xodepp shrestha <xodepp@gmail.com> - 2013-02-20 00:04 -0800
    Re: how to access object of one class in another class Arved Sandstrom <asandstrom2@eastlink.ca> - 2013-02-20 05:27 -0400
      Re: how to access object of one class in another class Gene Wirchenko <genew@telus.net> - 2013-02-21 09:45 -0800
    Re: how to access object of one class in another class Lew <lewbloch@gmail.com> - 2013-02-20 08:09 -0800

#22384 — how to access object of one class in another class

Fromxodepp shrestha <xodepp@gmail.com>
Date2013-02-20 00:04 -0800
Subjecthow to access object of one class in another class
Message-ID<13ede5d6-5aa5-41b6-834e-330e5ae94000@googlegroups.com>
i am having problem in JDBC.there are two different class within same package name.one class is dbconnect and another is login. I need to call the dbconnect class within login class and i need to call the connection object from the dbconnect class in the login class.
Please help me 

[toc] | [next] | [standalone]


#22389

FromArved Sandstrom <asandstrom2@eastlink.ca>
Date2013-02-20 05:27 -0400
Message-ID<YF0Vs.830$Q91.526@newsfe26.iad>
In reply to#22384
On 02/20/2013 04:04 AM, xodepp shrestha wrote:
> i am having problem in JDBC.there are two different class within same package name.one class is dbconnect and another is login. I need to call the dbconnect class within login class and i need to call the connection object from the dbconnect class in the login class.
> Please help me
>
Start here: http://docs.oracle.com/javase/tutorial/

Part of what you need is specifically 
http://docs.oracle.com/javase/tutorial/java/index.html, and even more 
specifically http://docs.oracle.com/javase/tutorial/java/javaOO/index.html.

A newsgroup works best for targeted questions. If you don't know barely 
anything about a subject you need to read books and tutorials.

AHS

[toc] | [prev] | [next] | [standalone]


#22423

FromGene Wirchenko <genew@telus.net>
Date2013-02-21 09:45 -0800
Message-ID<b8nci85i8pks0pbol6n7tgqah9pfpn0d3s@4ax.com>
In reply to#22389
On Wed, 20 Feb 2013 05:27:19 -0400, Arved Sandstrom
<asandstrom2@eastlink.ca> wrote:

>On 02/20/2013 04:04 AM, xodepp shrestha wrote:
>> i am having problem in JDBC.there are two different class within same package name.one class is dbconnect and another is login. I need to call the dbconnect class within login class and i need to call the connection object from the dbconnect class in the login class.
>> Please help me
>>
>Start here: http://docs.oracle.com/javase/tutorial/
>
>Part of what you need is specifically 
>http://docs.oracle.com/javase/tutorial/java/index.html, and even more 
>specifically http://docs.oracle.com/javase/tutorial/java/javaOO/index.html.
>
>A newsgroup works best for targeted questions. If you don't know barely 
>anything about a subject you need to read books and tutorials.

     And a newsgroup is great for finding out about the good books and
tutorials.

Sincerely,

Gene Wirchenko

[toc] | [prev] | [next] | [standalone]


#22391

FromLew <lewbloch@gmail.com>
Date2013-02-20 08:09 -0800
Message-ID<31934753-760f-4666-b9b5-233f155a129b@googlegroups.com>
In reply to#22384
xodepp shrestha wrote:
> i [sic] am having problem in JDBC.there are two different class[es] within 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 connection 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 classes, 
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 
material available for free, just an online search away.

-- 
Lew

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web