Dear candidates you will find MCQ questions of Perl here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.
Share your questions by clicking Add Question
N
Q. What is the correct syntax for defining a class in Perl?
N
Q. Object in Perl an instance of a class?
N
Q. What is called when an object is created in Perl?
N
Q. What is the correct syntax for creating a new object in Perl?
N
Q. Which of these is not a type of method in Perl?
N
Q. What will be the output of the following Perl code?
use strict; use warnings; package vehicle; sub set_mileage{ my $class = shift; my $self = { 'distance'=> shift, 'petrol_consumed'=> shift }; bless $self, $class; return $self; } sub get_mileage{ my $self = shift; my $result = $self->{'distance'} / $self->{'petrol_consumed'}; print "$result\n"; } my $ob1 = vehicle -> set_mileage(2550, 175); $ob1->get_mileage();
N
Q. Destructor's in Perl are ___.
N
Q. What is method overwriting in Perl?
N
Q. Method overwriting can be used to implement run time polymorphism?
N
Q. Which of these are valid type of inheritance in Perl?
Don't have account? Register here.