Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: about calling sub class

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile about calling sub class

    Hi all,

    i need information about calling sub class to main class . Mainly what the issue is i created a main program in C drive and sub program in D drive and i created the object to sub-class now calling the sub-class to my main class with that reference but am geting error . please tell me if any command is there for this issue .


  2. #2
    Banned
    Join Date
    May 2010
    Location
    North Central Illinois
    Posts
    1,631
    My Mood
    Sleepy
    Thanks
    390
    Thanked 112 Times in 110 Posts

    Default Re: about calling sub class

    Quote Originally Posted by pokuri View Post
    Hi all,

    i need information about calling sub class to main class . Mainly what the issue is i created a main program in C drive and sub program in D drive and i created the object to sub-class now calling the sub-class to my main class with that reference but am geting error . please tell me if any command is there for this issue .
    They should be in the same drive. In fact, they kinda have to be, unless you want to spend a lot of time writing code for it to find the subclass.

    Are you calling the subclass itself as a parameter to a method?

    If so, you could always do this:

    public dateType name (MainClass mc)
    {

    }


    Your SubClass will always be a main class.

  3. #3
    Junior Member
    Join Date
    Jan 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Re: about calling sub class

    Tanq for ur reply

  4. #4
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,237
    Thanks
    176
    Thanked 817 Times in 760 Posts
    Blog Entries
    5

    Default Re: about calling sub class

    Suggested reading: Path and Classpath

Similar Threads

  1. Calling method from .class file
    By alexx_88 in forum Java Theory & Questions
    Replies: 6
    Last Post: April 24th, 2012, 02:14 AM
  2. Calling the actionlistener class depending on variables
    By zidsal in forum Java Theory & Questions
    Replies: 3
    Last Post: January 5th, 2011, 07:52 AM
  3. calling a java a class connected to derby from a batch file
    By Reem in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 31st, 2010, 03:01 PM
  4. Help Calling Method From Another Class
    By CheekySpoon in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 15th, 2010, 09:24 AM
  5. [SOLVED] How to call string in another class in java?
    By tazjaime in forum What's Wrong With My Code?
    Replies: 4
    Last Post: April 23rd, 2009, 09:31 AM