Results 1 to 3 of 3
  1. #1
    Grkn is offline Member
    Join Date
    Oct 2011
    Posts
    65
    Rep Power
    0

    Default Is there anyone who can example simple code

    Class [] argTypes = new Class[] { String.class};

    First question: is it casting to string?
    Second question: String.class ??? As I know String class is not primitive type so how does it work?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default Re: Is there anyone who can example simple code

    Quote Originally Posted by Grkn View Post
    Class [] argTypes = new Class[] { String.class};

    First question: is it casting to string?
    No, there are no casts involved here.

    Second question: String.class ??? As I know String class is not primitive type so how does it work?
    String.class is a static property of String that holds its Class type, just as Boolean.class is that for boolean, and Integer.class for int.
    Last edited by Fubarable; 10-16-2011 at 03:27 AM.

  3. #3
    Grkn is offline Member
    Join Date
    Oct 2011
    Posts
    65
    Rep Power
    0

    Default Re: Is there anyone who can example simple code

    Thank you :)

Similar Threads

  1. need a simple code for the following
    By payal in forum New To Java
    Replies: 3
    Last Post: 09-14-2011, 01:24 AM
  2. Simple code. Could you help pls..?
    By Iliyas in forum New To Java
    Replies: 8
    Last Post: 12-26-2008, 03:17 AM
  3. Simple code help
    By rednose in forum New To Java
    Replies: 11
    Last Post: 11-30-2008, 06:02 AM
  4. Please help me this is simple bit of code
    By BlitzAcez in forum New To Java
    Replies: 4
    Last Post: 11-27-2008, 05:52 AM
  5. simple code
    By elizabeth in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 06:49 PM

Posting Permissions

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