Results 1 to 11 of 11
  1. #1
    javaprgr is offline Member
    Join Date
    Jul 2010
    Posts
    3
    Rep Power
    0

    Default stringto()?? exmaple??

    can someone explain wat does the method stringto() does? also can u plz give an example? thnx!!!

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    I don't know any class that implements stringto(). Where is that from?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    blddy txt spk...

  4. #4
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    dun u undrstnd hm?
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  5. #5
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    I spend the weekends trying to get my kids not to mumble stuff at me...and txt spk is the written equivalent of mumbling.

    Or put another way.

    np. dnt ndrstnd a wrd.

  6. #6
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    Quote Originally Posted by Tolls View Post
    I spend the weekends trying to get my kids not to mumble stuff at me...
    Ooh, I know that :)
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  7. #7
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,773
    Blog Entries
    7
    Rep Power
    21

    Default

    Quote Originally Posted by PhHein View Post
    I don't know any class that implements stringto(). Where is that from?
    Same as the codehash() method ...

    kind regards,

    Jos ;-)

  8. #8
    FacaNaCaveira is offline Member
    Join Date
    Jul 2010
    Location
    Rio de Janeiro, Brazil
    Posts
    8
    Rep Power
    0

    Default

    Hi javaprgr,
    maybe you are find a error, the correct name of this method is toString. Am i understand your answer?


    like this:
    Java Code:
    public class Gamer {
    
        private String name;
        private Integer age;
        private String address;
    
    //Construtor
        public Gamer() {
        }
    
        public Gamer(String name, Integer age, String address) {
            this.name = name;
            this.age = age;
            this.address = address;
        }
    
    //Gets and Sets
        public String getAddress() {
            return address;
        }
    
        public void setAddress(String address) {
            this.address = address;
        }
    
        public Integer getAge() {
            return age;
        }
    
        public void setAge(Integer age) {
            this.age = age;
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        //Method toString
        public String toString() {
            return name + "," + address + "," + age;
        }
    }
    Method toString output all atributes in the Class
    Exemple in the main

    Java Code:
    public static void main(String[] args) {
        Gamer g = new Gamer('Mike',15,'15ª Flower Ave.');
        System.out.println(g.toString())//output =Mike,15,15ª Flower Ave.
       
    }
    Abração
    Max:cool:

  9. #9
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    7

    Default

    Nice spoon feeding and thanks for thwarting our attempts to teach the OP to post decent questions.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,224
    Rep Power
    20

    Default

    I hate being thwarted...curses!

  11. #11
    Singing Boyo is offline Senior Member
    Join Date
    Mar 2009
    Posts
    552
    Rep Power
    6

    Default

    lmao (txt spk agn lol)

    On the funny side - the OPs username is txt spk. prgr - programmer :O

    I feel for you about the spoon-feeding thing, thats for sure. And after all your hard effort too!
    If the above doesn't make sense to you, ignore it, but remember it - might be useful!
    And if you just randomly taught yourself to program, well... you're just like me!

Posting Permissions

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