0

can someone explain these.

And the difference between abstract and interfaces?

These confuse me.

Ta

Also if you're asked to write a bit of code what tasks can i expect and can i assume i'll be given any resources or just pen and paper?

Edited by iamthwee

3
Contributors
6
Replies
8
Views
5 Years
Discussion Span
Last Post by Morta
0

A singleton is a class which provides you with one, and only one, instance of that class.

The scope resolution operator is an operator that allows you access to constants and static methods of a class. You can compare it to -> which you use to access instance variables and methods.

An abstract class basically defines a set of methods. You cannot create an instance of such a class. You have to create a descendant class which must implement any and all abstract methods from the parent.

An interface defines a set of methods (no implementation), which a class implementing that interface must define.

Read more here.

1

i think the scope resolution operator "::", called using :: .the double colon, is a token that allows access to static, constant, and overridden properties or methods of a class. in this example below :

class Cart 
{   
private function __construct() {}
    /**
     * Fetch Cart instance
     *
     * @return Cart
     */
    public  function getInstance()
    {
        if (NULL === self::$_instance) {
            self::$_instance = new self;
        }

        return self::$_instance;
    }
}
// initialize shopping cart
// note that Cart implements Singleton pattern
$cart = Cart::getInstance();

in oop ,abstract class is a class contains at least one abstract function (may contain normal function),and it couldn't be instantiated .but the interface contains just abstract functions, it dosen't contain any normal function...

I wish it's helpfull,,,,,
%%^Murtada^%%

Votes + Comments
thanks
0

Thanks guys...

Know this might be a daft question but I know I'm going to have to write a bit of code. But I have no idea what to expect... What difficultly, if I'll be given resources (computer internet connection etc) or just a pen and pad.

Is there anyway to prepare or what?

ta

1

I've never had to do anything like that, so can't help. Pen and paper is about logic structures or algorithms usually. An IDE means they want to know about your actual PHP skills (indenting, commenting, variable naming, what functions do you use, usage of classes, etc.) so they can easily weed out the script kiddies.

Edited by pritaeas

0

iamthwee,it;s code ,you need to apply it,it's better to use computer.(write->test->correct wrongs->worked program!!) :))
%%^Murtada^%%

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.