Skip to main content

Posts

Showing posts from March, 2018

PHP Traits - Multiple Choice Questions

PHP Traits - Multiple Choice Questions A PHP trait is a partial class implementation (i.e. constants, properties and methods) that can be mixed into one or more existing PHP classes. Traits work double duty: they say what a class can do (like an interface), and they provide a modular implementation (like a class). [Modern PHP: New Features and Good Practices By Josh Lockhart] Try below quiz questions and check your knowledge on PHP Traits . 1) We use . . . . . keyword to declare a trait and . . . . keyword is used in order to include it in a class. A) Declare, Use B) Initiate, Include C) Trait, Use D) none of above 2) We can use above trait in any of the class as: A) class Welcomeclass{ use Trait Welcome; } B) class Welcomeclass{ use Welcome: } C) class Welcomeclass{ use Welcome; } D) class Welcomeclass{ use=> Welcome; } 3) Methods declared in a class using a trait take precedence over methods declared in the trait. However, methods in a trait will override method...

Past Participle Exercises - Set 2

Past Participle Exercises - Set 2 Past participle is generally formed by adding 'ed' or 'd' to the base form of a verb and is the same as the past tense form of the verb. For example the past participle of 'back' is 'backed'. Some irregular verbs have past participles that are not formed by adding 'ed' or 'd' and may not be the same as the past tense form of the verb. The past participle of 'see' is 'seen'. Complete the below sentences using past participles. 1) Ricky had already . . . . . . the traffic rules by crossing the red lights. (broke,broken) 2) Nina had . . . . . . all of her coke before her dinner arrived. (drank, drunk) 3) The oysters were . . . . . in the sand now, covered by a few inches of sea water. (sank, sunk) 4) Garry had . . . . . . his son to work a couple of times. (bring, brought) 5) The red company has always . . . . . . its employees on Fridays. (pay, paid) 6) I felt awful as I had . ....

Angular 4 Pipes Multiple Choice Questions with Answers

Angular 4 Pipes Multiple Choice Questions with Answers Pipes transform displayed values within a template. A pipe takes in data as input and transforms it to a desired output. [ via ] Practice your Angular 4 Pipes skills by answering below Angular 4 Pipes multiple choice questions with answers. 1) Just like filters in AngularJS, pipes are intended to encapsulate all the data transformation logic. A) True B) False 2) Using SlicePipe, answer below question: var = "abcdefghijk"; {{var | slice:3:-3}} A) defghi B) defgh C) kjih D) abc 3) The Angular pipes differ in functionality from simple case changing to date and internationalisation, but most importantly, you can't write your own pipes. A) True B) False 4) The number pipe is location sensitive, which means that the same format argument will produce differently formatted results based on the . . . . . . . A) user's format setting B) user's currency setting C) user's locale setting D) all of ab...