Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2007

Tip: Looking for answers? Try searching our database.

getClass

Thread view: 
Francois Lionet - 05 Jun 2007 15:00 GMT
Hello all,

A question that might stupid to you who knows. But I cant find it in the
doc.
I want to play sounds, and I found code with :

AudioInputStream stream =
AudioSystem.getAudioInputStream(getClass().getResource(fnm));

"getClass" : what is the base object? I cant find it in the system object or
anywhere in the doc. It seems to be a default object.

Thanks, Francois
Stefan Ram - 05 Jun 2007 15:19 GMT
>AudioSystem.getAudioInputStream(getClass().getResource(fnm));
>"getClass" : what is the base object?

   »this«?
Andrew Thompson - 05 Jun 2007 15:25 GMT
...
>"getClass" : what is the base object?

Any instance of an Object or any class that extends
it (explicitly or implicitly) (cough)..
<http://java.sun.com/javase/6/docs/api/java/lang/Object.html#method_detail>
(1st listed method)
..closely followed by..
<http://java.sun.com/javase/6/docs/api/java/lang/Class.html#getResource(java.lang
.String

)>

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Francois Lionet - 05 Jun 2007 15:40 GMT
> ..
>>"getClass" : what is the base object?
> Any instance of an Object or any class that extends
> it (explicitly or implicitly) (cough)..

So simple. Thanks.

Francois
Mike  Schilling - 05 Jun 2007 23:14 GMT
> ..
>>"getClass" : what is the base object?
>
> Any instance of an Object or any class that extends
> it (explicitly or implicitly)

ITYM "(directly or indirectly)".
Roedy Green - 05 Jun 2007 23:22 GMT
On Tue, 5 Jun 2007 16:00:54 +0200, "Francois Lionet"
<flionet@hotmail.fr> wrote, quoted or indirectly quoted someone who
said :

>A question that might stupid to you who knows. But I cant find it in the
>doc.
[quoted text clipped - 5 lines]
>"getClass" : what is the base object? I cant find it in the system object or
>anywhere in the doc. It seems to be a default object.

this, which in that case would be the Applet object.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.