Results 1 to 10 of 10

Thread: [RESOLVED] Values for Types

  1. #1

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Resolved [RESOLVED] Values for Types

    Hi,

    Where can I find info on how to set types?

    For example I know string and boolean but I don't know about Address, etc.

    Code:
        public  final String FIRST_NAME = "";
        public final String LAST_NAME = "";
        public final Address ADDRESS = "";
        public final String PHONE_NUMBER ="";
        public final boolean FULL_TIME = false;
        public final boolean CURRENT = false;
    Thanks,


    Nightwalker
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Values for Types

    Is it your code or someone elses?

    If it is your code, most IDEs have a way to "Go to Definition" for stuff like that. If it someone elses code, you may want to look into their documentation.

  3. #3
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Values for Types

    public final Address ADDRESS = "";
    You are assigning empty string to it ?

    I think the datatype Address is typed wrong instead of String.

    It might be like this:
    Code:
    public  final String FIRST_NAME = "";
        public final String LAST_NAME = "";
        public final String ADDRESS = "";
        public final String PHONE_NUMBER ="";
        public final boolean FULL_TIME = false;
        public final boolean CURRENT = false;
    You should check the complete code. Did you tried running it ?

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Values for Types

    Quote Originally Posted by kfcSmitty View Post
    Is it your code or someone elses?

    If it is your code, most IDEs have a way to "Go to Definition" for stuff like that. If it someone elses code, you may want to look into their documentation.
    It's part of an assignment I need to do for my beginner java class.

    The comments above that block of code are:

    //TODO create defaults for all instance variables
    // Default values are:
    // firstName -> Not set
    // address -> null
    // phoneNumber -> Not set
    // fullTime -> false
    // current -> false

    I guessing that by null all I need to do this?

    Code:
     public final Address ADDRESS = null;
    Quote Originally Posted by akhileshbc View Post
    You are assigning empty string to it ?
    Sorry, I put it like that while trying to figure out what value should be there. It is not a string but an address.
    Last edited by Nightwalker83; Sep 7th, 2010 at 06:05 PM.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Values for Types

    Yup... it can be initialized to either null or a new instance of Address.

    public final Address ADDRESS = new Address();

    If initialized to an instance, its either default constructor or one that requires parameters be passed.

  6. #6

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Values for Types

    Do you know a website which explains all of the types and how to use them?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Values for Types

    It's either a native type or an object, usage of object depends on how object is defined.

  8. #8

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Values for Types

    Quote Originally Posted by leinad31 View Post
    It's either a native type or an object, usage of object depends on how object is defined.
    Sorry, I'm not referring to Address in my previous post but types in general.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #9

  10. #10

    Thread Starter
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Values for Types

    Thanks.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

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



Click Here to Expand Forum to Full Width