Results 1 to 7 of 7

Thread: .class

  1. #1
    Gudradain is offline Member
    Join Date
    Nov 2008
    Posts
    44
    Rep Power
    0

    Default .class

    Reading about dataflavor I found something strange. It seems you can write

    ArrayList.class

    to get the representation class of an array list for example. I guess you can do it with every class.

    But, where this .class come from? I don't see it in any field summary in the api

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    10

    Default

    static field which store Class<T> object ?
    Last edited by mtyoung; 12-31-2008 at 10:10 AM.

  3. #3
    Gudradain is offline Member
    Join Date
    Nov 2008
    Posts
    44
    Rep Power
    0

    Default

    Quote Originally Posted by mtyoung View Post
    static field which store Class<T> object ?
    You see it in the API??

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    23

  5. #5
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    10

    Default

    guess only
    can try to search what registerNatives done in Object class
    Last edited by mtyoung; 12-31-2008 at 12:11 PM.

  6. #6
    Join Date
    Dec 2008
    Location
    Italy
    Posts
    79
    Rep Power
    0

    Default

    Java language specification, 2nd online version

    aic ti ti pi colon slash slash
    java.sun.com/docs/books/jls/second_edition/html/expressions.doc.html#251530

    Copy and paste. My post count is less then 20...
    It is also explained in the official Sun tutorial. However you can use the getClass() method

  7. #7
    Gudradain is offline Member
    Join Date
    Nov 2008
    Posts
    44
    Rep Power
    0

Similar Threads

  1. Calling a method on original class from created class
    By kpedersen in forum Advanced Java
    Replies: 4
    Last Post: 08-20-2008, 01:25 AM
  2. Replies: 0
    Last Post: 05-13-2008, 07:16 AM
  3. Class Reflection: Finding super class names
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-23-2008, 09:12 PM
  4. Class Reflection: Finding class modifiers
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-23-2008, 09:11 PM
  5. Replies: 0
    Last Post: 04-02-2008, 08:04 AM

Posting Permissions

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