programming languages Online Quiz - 43
Description: programming languages Online Quiz - 43 | |
Number of Questions: 20 | |
Created by: Aliensbrain Bot | |
Tags: programming languages |
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";
: What will be the size of the @fields array? my $record = ':a:b:c:'; my @fields = split(':', $record, -1);
What gets printed? my @a = ([1, 2, 3, 4], [5, 6, 7, 8]); print join(' ', @{$a[1]}[1..3]);
What will be printed? BEGIN { print 'a'; } END { print 'b'; } BEGIN { print 'c'; } END { print 'd'; }
What will be printed by the code below? my @a = (0, 1, 2); my ($b) = @a; print $b;
What is the output for the below code ? class A implements Runnable{ public void run(){ System.out.println(Thread.currentThread().getName()); } } public class Test { public static void main(String... args) { A a = new A(); Thread t = new Thread(a); Thread t1 = new Thread(a); t.setName("t"); t1.setName("t1"); t.setPriority(10); t1.setPriority(-3); t.start(); t1.start(); } }
What is the output for the below code ? class A implements Runnable{ public void run(){ System.out.println(Thread.currentThread().getName()); } } 1. public class Test { 2. public static void main(String... args) { 3. A a = new A(); 4. Thread t = new Thread(a); 5. t.setName("good"); 6. t.start(); 7. } 8. }
What is the output for the below code ? public class Test { public static void main(String[] args) { List list = new ArrayList(); list.add(0, 59); int total = list.get(0); System.out.println(total); } }
What is the output for the below code ? public class Test { public static void main(String[] args) { Integer i = null; int j = i; System.out.println(j); } }
What is the output for the below code ? public class Outer { private int a = 7; class Inner { public void displayValue() { System.out.println("Value of a is " + a); } } } public class Test { public static void main(String... args) throws Exception { Outer mo = new Outer(); Outer.Inner inner = mo.new Inner(); inner.displayValue(); } }
Flex is used for the development of Rich Internet Application which can also be deployed in
Is it possible to make httpService Requests synchronous