• 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

what are the class without methods in java lang package

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
could anybody please tell what are the classes that doesn't have any methods in java.lang package.

Thanks
vamshi
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vamshidhar nimbagiri:
could anybody please tell what are the classes that doesn't have any methods in java.lang package.



It's not clear what you are asking. Methods belong to classes and classes to packages. It doesn't make much sense to ask about where or not a method per se is in a package. And the list of classes not in java.lang is rather long. Does looking at the API solve your problem, whatever it was?

http://java.sun.com/j2se/1.5.0/docs/api/
 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vamshidhar,

I beleive that all classes in the java.lang package have some methods, thoose inherited java.lang.Object (though i could be wrong)

Looking through the API docs may offer the answer to your questions on this score; java.lang.Void only has methods inhertied from object; but it is an "uninstantiable placeholder class to hold a reference to the Class object representing the Java keyword void"

http://java.sun.com/j2se/1.5.0/docs/api/

Shaun
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't even have to look in the documentation for that. Every class has at least the 11 methods inherited from java.lang.Object.
 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for all of you,

Actually this question is asked by one of the interviewer.

He asked me :

which classes in java.lang package doesnt have methods in it.

Thanks
vamshidhar
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps your interviewer was thinking of this koan:

A NEW monastery was to be opened, and the master Hyakujo had to
decide which of his monks should be put in charge. So he called
the monks together, filled a vase with water, and said to them:

"Which one of you can say what this is without giving its name?"

The chief monk, who expected to be given the new mastership, spoke
first. "It stands upright, it is hollow inside, but it is not a
wooden shoe," he said.

Another monk said, "It is not a pond, because it can be carried."

Then the cook, lowest of the monks, arose. He kicked over the vase
with his foot, so the water ran out on to the floor. He had shown
how to achieve emptiness.

Hyakujo gave him the job.

 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
May be you are right Jeff
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doubly so, since the only class (in 1.4) that has no public or protected methods beyond Object's is java.lang.Void!
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The interviewer may have meant to include interfaces in with classes. Several "marker" interfaces have no methods.

Read up on Serializable and see if you can figure out why. Find the definition of Java interface and see if you can see why object purists find marker interfaces offensive. For the OP only
[ March 22, 2006: Message edited by: Stan James ]
 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for All of you again.



Thanks very much!!!
 
vamshidhar nimbagiri
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for All of you again.



Thanks very much!!!
 
I can't renounce my name. It's on all my stationery! And hinted in this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic