×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Aug 2013
    Posts
    37

    [moved] Help needed in solving this problem..

    I have a package named nokia in which there is a class a which calls a method from a class b which is outside the package.. But during compiling it says connot determine simply type name b; my codes..
    .
    package nokia;
    public class a
    {
    public a()
    {
    }
    public void doWork()
    {
    new b().m();
    }
    }
    .
    .
    .
    import nokia.*;
    public class b
    {
    public b()
    {
    }
    public void m()
    {
    //doing work
    }
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Help needed in solving this problem..

    have you tried adding import clause into the java file already ?

  3. #3
    Registered User
    Join Date
    Aug 2013
    Posts
    37

    Re: Help needed in solving this problem..

    Yes.. You can see what i have done in my code below..

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Help needed in solving this problem..

    what about importing the b, before using it. Have you tried that ?

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: Help needed in solving this problem..

    It is simply not possible to do. A package-d class can not import a package-less one.
    See langspec http://docs.oracle.com/javase/specs/...tml/jls-7.html, the explanation at the end of 7.5 in particular.

    The thread is moved to the Java boards now.
    Last edited by wizard_hu_; 2013-08-12 at 17:33.

  6. #6
    Nokia Developer Champion
    Join Date
    Mar 2013
    Posts
    682

    Re: Help needed in solving this problem..

    ????
    Your code is not complete and therefor we cannot fully help you and your leading us wrong paths.
    Please post your full code if you wish to get better help.
    There is no problem in importing one class or one package or class that sits outside the current class package in java.
    also you should note that classes name should start with Upper case as this is the convention.

  7. #7
    Registered User
    Join Date
    Aug 2013
    Posts
    37

    Re: [moved] Help needed in solving this problem..

    Ok thanks to all. I have done it and it works.

Similar Threads

  1. [Moved] Problem tracking email with IMAP4. Help needed
    By waziz40 in forum Symbian Networking & Messaging (Closed)
    Replies: 4
    Last Post: 2011-08-09, 10:52
  2. Help Needed for solving error
    By amit.mangal in forum Symbian
    Replies: 29
    Last Post: 2009-10-03, 11:48
  3. [moved] Problem not fixed yet HELP NEEDED
    By joshi007 in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2009-09-10, 15:20
  4. [Moved] Guidance needed
    By philippeflorent in forum Near Field Communication
    Replies: 4
    Last Post: 2008-08-19, 15:26
  5. gone nuts in solving strange database problem
    By asheeshv in forum Symbian
    Replies: 4
    Last Post: 2005-04-14, 12:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×