• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Constructor Not Visible?

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is Class file called org.smslib.InboundMessage which i want to use in my Project.so Just I Instantiated the Class By calling the Constructor....But the error coming was Construtor is not visible.......The class Contained three Overloaded Constructors ,not single one responding....I saw the sourse too no constructor was private or default.........Then what would the problem...........

Any Body please tell me the mistake .............
Thanks in Advance....................
[ February 01, 2008: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 694
Mac OS X Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the class is in a different package, you'll have to import the class into your source file, using the keyword import.
 
Arun Kumar Gaddam
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have done with all the imports,setting classpaths all the necessary things but invain......the problem is constructor not visible.............
 
Ranch Hand
Posts: 433
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you check ..may be the class is abstract..!!
can you tell us what is the exact error you are getting..!!
paste the same error here..!!
 
Arun Kumar Gaddam
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Exact error is.............

Constructor InboundMessage(MessageTypes,String,int) is not visible
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post a bit of your code with the imports, class heading, the bit which isn't working, and the constructor and class heading for the InboundMessage class.
 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Campbell Ritchie:
Please post a bit of your code with the imports, class heading, the bit which isn't working, and the constructor and class heading for the InboundMessage class.



Also, since you said you have the code for the class you're trying to instantiate, it probably wouldn't hurt to have a look at that - at least the constructors that are not visible.
 
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you checked if maybe the class contains a static method for retrieving an instance? Something like getInstance(), or getInboundMessage(), etc.
 
Arun Kumar Gaddam
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


This is my code........



And this is the construtors code..........
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


super(type, null, null)


The exception message is telling you that the constructor you call here is not visible, i.e. it is private or has package visibility. Are you sure the source you looked at is the source you are calling?

Because you pass null arguments, are you sure you are calling the constructor you think you are?
[ February 07, 2008: Message edited by: Paul Sturrock ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic