Aliensbrain
  • Home
  • Topics
  • Quizzes
  • Notebooks
  • Community
  • Sign in
  • programming languages Online Quiz - 43
  • What gets printed? package A; sub new { my $class = ...

What gets printed? package A; sub new { my $class = shift; my $self = {}; $self->init(); return bless $self, $class; }; sub init { my $self = shift; $self->{key} = 'value'; } sub get { my ($self, $key) = @_; return $self->{$key}; } package main; my $obj = A->new(); print $obj->get('key'), "\n";

technology programming languages
  1. empty string

  2. value

  3. the code will fail

  4. None of the above


Show answer
Correct Option: C

Find more quizzes:

© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy