Advanced Web Technologies Solved MCQs

Multiple Choice Questions 53 Pages
FT

Contributed by

Falguni Talwar
Loading
  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    Class:- TYBBA(CA) ( Semester VI)
    Subject :- ADVANCE WEB TECHNOLOGY
    Unit 1:- Introduction to Object Oriented Programming in PHP
    Question Bank Multiple Choice Questions (MCQ)
    --------------------------------------------------------------------------------------
    1)Which method scope prevents a method from being overridden by a subclass?
    a)Abstract
    b)Protected
    c)Final
    d)Static
    2) Which of the following statements are true is/are true about constructors in PHP?
    (i) PHP 4 introduced class constructors.
    (ii) Constructors can accept parameters.
    (iii) Constructors can call class methods or other functions
    (iv) Class constructors can call on other constructors.
    (a)All of the mentioned
    (b) None of the mentioned
    (c) only i
    (d) only ii
    3) PHP recognize constructors by the name.
    a. ) class name()
    b) _construct()
    c) function _construct()
    d) function __construct()
    4) Which version of PHP introduced the instance of keyword?
    a) PHP 4
    b). PHP 5
    c). PHP 5.3
    d). PHP 6

    Page 1

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    5) Which one of the following functions is used to determine whether a class exists?
    a). exist()
    b.) exist_class()
    c )class_exist()
    d.exist()
    6) Which one of the following functions is used to determine object type?
    a.) obj_type()
    b) type()
    c ) is_a()
    d) is_obj()
    7) Which one of the following keyword is used to inherit our subclass into a superclass?
    a). extends
    b). implements
    c). inherit
    d). include
    8) In the PHP code given below, what is/are the properties?
    < ?php
    class Example
    {
    public $name;
    function Sample()
    {
    echo "This is an example";
    }
    }
    ?>
    a). echo “This is an example”;
    b). public $name;
    c) class Example
    d). function sample()
    9) Which keyword is used to refer to properties or methods within the class itself?
    a). private
    b) public
    c) protected
    d). $this

    Page 2

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    10) Which keyword allows class members (methods and properties) to be used without
    needing to instantiate a new instance of the class?
    a) protected
    b). final
    c) static
    d)private
    11)_________ is a blue print of any object in OOP.
    a) class
    b) object
    c) Construct
    d) Serializing
    12) An _____ is an instance or occurrence of our class.....
    a) class
    b) object
    c) Construct
    d) Serializing
    13) The _____ method starts with two underscores (__).
    a) class
    b) object
    c) Construct
    d) Serializing
    14) _______an object means converting it to a byte stream representation that can be
    stored into file.
    a) class
    b) object
    c) Construct
    d) Serializing
    15) A class property used by another class is called ______.
    a) Abstract class
    b) Interface
    c) Encapsulation
    d) inheritance.

    Page 3

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    16) _________is used to support multiple inheritance
    a) Abstract class
    b) Interface
    c) Encapsulation
    d) inheritance.
    17) The ability to hide the details of implementation is known as _____.
    a) Abstract class
    b) Interface
    c) Encapsulation
    d) inheritance.
    18) An _______ is one that cannot be instantiated, only inherited
    a) Abstract class
    b) Interface
    c) Encapsulation
    d) inheritance.
    19) Constant name are proceeded by _____ like a normal variable declaration.
    a) Abstract class
    b) dollar sign($)
    c) Encapsulation
    d) inheritance.
    20) _______ is available when a method is called from within an object context
    a) Abstract class
    b) dollar sign($)
    c) $this
    d) inheritance.
    21) in PHP, An _____is a special variable, which can hold more than one value at
    a time.
    a) array
    b) structure
    c) csss
    d) none of these

    Page 4

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    22) In PHP, there are three types of arrays:
    a) Indexed arrays -
    b) Associative arrays -
    c) Multidimensional arrays -
    d) all of the above
    23) in PHP ,The____ function is used to return the length (the number of
    elements) of an array:
    a) count
    b) min
    c) abs
    d) sqrt()
    24) The index can be assigned automatically (index always starts at 0), like
    this:
    $cars = array("Volvo", "BMW", "Toyota");
    a) true
    b) false
    c) both a and b
    d) none of these
    25) The _____ functions can be used to find the lowest or highest value in a list of
    arguments:
    a) count & num
    b) min & max
    c) abs & count
    d) sqrt() & round

    Page 5

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    26) The _____ function returns the absolute (positive) value of a number:
    a) count
    b) min
    c) abs
    d) sqrt()
    27) the _____function returns the square root of a number:
    a) count
    b) min
    c) abs
    d) sqrt()
    28) The _____function rounds a floating-point number to its nearest integer:
    a) round
    b) min
    c) abs
    d) sqrt()

    Page 6

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    29) The _______ function generates a random number:
    a) rand
    b) min
    c) abs
    d) sqrt()
    30) To create a constant, use the _____ function.is used
    a) define()
    b) min()
    c) abs()
    d) sqrt()
    31) In PHP7, you can create an Array constant using the ____ function.
    a) define()
    b) min()
    c) abs()
    d) sqrt()

    Page 7

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    32) The ____statement is used to perform different actions based on
    different conditions.
    a) switch
    b) min
    c) abs
    d) sqrt()
    33) The PHP ____function formats a timestamp to a more readable date and time.
    a) date()
    b) min()
    c) abs()
    d) sqrt()
    34) A ______is a small file that the server embeds on the user's computer. Each
    time the same computer requests a page with a browser, it will send the cookie too.
    With PHP, you can both create and retrieve cookie values.
    a) cookie
    b) session
    c) abs
    d) sqrt

    Page 8

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    35) A ______ is a way to store information (in variables) to be used
    across multiple pages.
    a) cookie
    b) session
    c) abs
    d) sqrt
    36) _______are the two main aspects of object-oriented programming.
    a) classes and objects
    b) constructor and destructor
    c) object and array
    d) none of these
    37) A ______allows you to initialize an object's properties upon creation of the
    object.
    a) classes
    b) constructor
    c) object
    d) none of these

    Page 9

  • DNYANSAGAR ARTS AND COMMERCE COLLEGE, BALEWADI,PUNE-45
    PROF. YOGESH P.DESHMUKH www.dacc.edu.in
    38) If you create a __construct() function, PHP will automatically call this
    function when you create an object from a class.
    a) true
    b) false
    c) both a and b
    d) none of these
    39) A ______is called when the object is destructed or the script is stopped or
    exited.
    a) destructor
    b) constructor
    c) object
    d) none of these
    40) If you create a __destruct() function, PHP will automatically call this
    function at the end of the script.
    a) true
    b) false
    c) both a and b
    d) none of these
    Answer of unit 1:
    1(c)
    2(a)
    3(d)
    4(b)
    5(c)
    6(c)
    7(a)
    8(b)
    9(d)
    10(c)
    11(a)
    12(b)
    13(c)
    14(d)
    15(d)
    16(b)
    17(c)
    18(a)
    19(b)
    20(c)
    21(a)
    22(d)
    23(a)
    24(a)
    25(b)
    26(c)
    27(d)
    28(a)
    29(a)
    30(a)
    31(a)
    32(a)
    33(a)
    34(a)
    35(b)
    36(a)
    37(b)
    38(a)
    39(a)
    40(a)

    Page 10

Download this file to view remaining 43 pages

logo StudyDocs
StudyDocs is a platform where students and educators can share educational resources such as notes, lecture slides, study guides, and practice exams.

Contacts

Links

Resources

© 2025 StudyDocs. All Rights Reserved.