Jump to content

webbhelp

Members
  • Posts

    57
  • Joined

  • Last visited

Everything posted by webbhelp

  1. Ok, now I understand, sorry Thanks to you all, for helping, you know... I really appreciate it, thanks
  2. Yeah, that's true. I think I understand the most of it now. summary: An object, is like a variable that I can use in the class, like a property for an class. am I right, that object is only for the class, like a variables. Sorry if I ask to much, but this is new for me and I really want to learn it. Thanks
  3. Maybe this is a silly question but I will ask it anyway $this->speed = 0; If I want to give speed a value = $_GET['speed']; can I write: $this->speed = $_GET['speed']; Or need I do like this: class Car { public $wheels; public $engine; public $steering; public $colour; public $speed; public function __construct($speed) { $this->setEngine(); $this->setColour(); $this->setWheels(); $this->speed = 0; } $class = new Car(10); And then I give the car value = 10? Can I give it a value with $_GET['speed']; You now I am little confused about this, this is the first time I use OOP but you are helping me now and I think I understand it much more now. Thanks
  4. Ok, I understand, thanks -------- public function __construct() { $this->setEngine(); $this->setColour(); $this->setWheels(); $this->speed = 0; } Does it start the functions: setEngine() setColour() setWheels()
  5. Thanks and thanks again. Now it feels like a new world has been open in front of me Almost everything feels right, I understand the most now but I only got some question. class Car { public $wheels; public $engine; public $steering; public $colour; public $speed; public function __construct() { $this->setEngine(); $this->setColour(); $this->setWheels(); $this->speed = 0; } What is construct, is that code starting all methods: $this->setEngine(); $this->setColour(); $this->setWheels(); $this->speed = 0; or what does it do? AND public function setWheels($wheels = 4) { $this->wheels = $wheels; } ..eels($wheels = 4) You give wheels value 4 why? Is it only because you want it to have a standard value but then you can give it a new value if you want or? BTW, thanks again, I really appreciate (Difficult word) that you helping me, thanks :=)
  6. Thanks for reply, but the thing is that everytime I asked I got links as reply, but I acutally still don't really understand what an object is. class test { } If you would write an object, i that class, how would you do? maybe it is more easier to understand with code. But thanks you for replying...
  7. Hi! This is my first post and I am not an expert on english, so... this can be funny I have started with PHP OOP yesterday and it feels like I'm getting better and better but one thing I don't understand is objects. I actually don't know what an object is at all. I create a class: class test { //and then the object (I think) public obj = 'tjo'; } Now the question; That I just wrote, is that an object? What can I do with object, is it only like variables in an class that got information that I can use in the class? Or what is an object? Thanks //WebbHelp PS. I hope you understand what I was wrote .
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.