Results 1 to 4 of 4

Thread: is void a type?

  1. #1
    mary is offline Member
    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    0

    Default is void a type?

    I'm new in java and when I was reading a tutorial about it.
    I see this
    Java Code:
    public void setAge(int age){
      this.age=age;
    }
    what kind of type is void? what does it represent? what does it mean?
    can you help me?
    please

  2. #2
    shanePreater is offline Member
    Join Date
    Jul 2007
    Location
    England, Bath
    Posts
    47
    Rep Power
    0

    Default

    Void is kind of a type! In the context that you have shown in your code it represents nothing. This means in the case of your method you are not expecting anything to be returned from the method.

    Hope this helps. :D

  3. #3
    mary is offline Member
    Join Date
    Jul 2007
    Posts
    51
    Rep Power
    0

    Default

    I finally understood what it means
    thanks shanePreater

  4. #4
    shanePreater is offline Member
    Join Date
    Jul 2007
    Location
    England, Bath
    Posts
    47
    Rep Power
    0

Similar Threads

  1. Java Native Access (JNA) return types of void *
    By burnumd in forum Advanced Java
    Replies: 5
    Last Post: 01-15-2010, 12:09 AM
  2. Type Casting Help
    By rhm54 in forum New To Java
    Replies: 2
    Last Post: 02-07-2008, 12:06 PM
  3. Replies: 5
    Last Post: 01-24-2008, 11:53 PM
  4. The return type
    By Marcus in forum New To Java
    Replies: 1
    Last Post: 07-05-2007, 06:28 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
  •