JavaScript Test Solution
1. What’s relationship between JavaScript and ECMAScript? -
ECMAScript is yet another name for JavaScript (other names include LiveScript).
The current JavaScript that you see supported in browsers is ECMAScript revision 3.
2. What are JavaScript types? -
Number, String, Boolean, Function, Object, Null, Undefined.
3. How do you convert numbers between different bases in JavaScript? -
Use the parseInt() function, that takes a string as the first parameter, and the base as
a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);
4. What does isNaN function do? -
Return true if the argument is not a number.
5. What is negative infinity? -
It’s a number in JavaScript, derived by dividing negative number by zero.
6. What boolean operators does JavaScript support? -
&&, || and !
7. What does "1"+2+4 evaluate to? -
Since 1 is a string, everything is a string, so the result is 124.
8. How about 2+5+"8"? -
Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation,
so 78 is the result.
9. What looping structures are there in JavaScript? -
for, while, do-while loops, but no foreach.
10. How do you create a new object in JavaScript? -
var obj = new Object(); or var obj = {};
11. How do you assign object properties? -
obj["age"] = 17 or obj.age = 17.
12. What’s a way to append a value to an array? -
arr[arr.length] = value;
13. What is this keyword? -
It refers to the current object.
odesk Php Test Solution part 1
Question 1The setrawcookie() method of setting cookie is different from php standard method of cookie setting as :
Question 2
IF visibility is not defined for a method /member then it is treated as public static.
Ans: B
Question 3
Which of the following is not a valid php connection status?
Ans: C
Question 4
Which of the following statements is not true with regard to abstract classes in php5?
Question 5What will be the result of following operation?Print 4<<5;
a. 3b. 128c. 120d. 6
Ans: B
Question 6
Which of the following type cast in not correct?
$fig=23;$varbl=(real)$fig;$varb2=(double)$fig;$varb3=(decimal)$fig;$varb4=(bool)$fig;?>
Ans: C
Question 7
What is the result of the following expression?
5+2*4+6
Ans: B
Question 8
The classes are defined as followsAbstract class BaseCls(Protected abstract function getName();}Class childCls extends BaseCls{}Which of the following implementations of getName() in invalid in childCls?
a. Protected function getName(){}b. Function getName(){}c. Private function getName(){}d. Public function getName(){}
Ans: D
Question 9
Multiple select/load is possible with:
Ans : A
Question 10
State whether true or false
Paamayim nekudotayim operator allows access only to the static members of a class?
a. Trueb. False
Ans: A
Question 11
What is the output of the following code?
$a=500;$b=200;echo $a % 2 * $b;?>
Ans: D
Question 12
You need to heck the size of a file in php function .$size=X(filename);which function will suitable replace “X”?
Ans: A
Question 14Which of the following is not true for a persistent connection?
Ans: D
Question 15
Which one is correct?
Ans B
Question 16Which of the following in not a correct way of printing text in php 5
a. echo “plain text”?>b. c. d. <#echo “plain text”#>
Ans: C
Question 17
Which will be the output of the following code?
$a=0.0;
For($i=0;$i<10;$i++)$a+=0.1;print “$a\n”;if ($a==1.0)print “equals”;elseprint “not equals”;?>
Ans: C
Question 18
Which of the following attribute is needed for file upload via form?
Ans: A
Question 19
Late php versions support remote file accessing for the functions:
Ans : D
Question 20
Given below is a small php script:
class person {function getSal(){…………}}class emp extends person {fucniton getSal(){???}}?>the getSal() of emp has to behave exacltyle as getSal() of person . Which of the following lines of code would you use to replace the “???”?
Ans: A
N.B: FOR MORE CONTACT US.........
1. What’s relationship between JavaScript and ECMAScript? -
ECMAScript is yet another name for JavaScript (other names include LiveScript).
The current JavaScript that you see supported in browsers is ECMAScript revision 3.
2. What are JavaScript types? -
Number, String, Boolean, Function, Object, Null, Undefined.
3. How do you convert numbers between different bases in JavaScript? -
Use the parseInt() function, that takes a string as the first parameter, and the base as
a second parameter. So to convert hexadecimal 3F to decimal, use parseInt ("3F", 16);
4. What does isNaN function do? -
Return true if the argument is not a number.
5. What is negative infinity? -
It’s a number in JavaScript, derived by dividing negative number by zero.
6. What boolean operators does JavaScript support? -
&&, || and !
7. What does "1"+2+4 evaluate to? -
Since 1 is a string, everything is a string, so the result is 124.
8. How about 2+5+"8"? -
Since 2 and 5 are integers, this is number arithmetic, since 8 is a string, it’s concatenation,
so 78 is the result.
9. What looping structures are there in JavaScript? -
for, while, do-while loops, but no foreach.
10. How do you create a new object in JavaScript? -
var obj = new Object(); or var obj = {};
11. How do you assign object properties? -
obj["age"] = 17 or obj.age = 17.
12. What’s a way to append a value to an array? -
arr[arr.length] = value;
13. What is this keyword? -
It refers to the current object.
odesk Php Test Solution part 1
Question 1The setrawcookie() method of setting cookie is different from php standard method of cookie setting as :
- It does not allow expiry time to be set
- It can be used only once
- It does not url- ENCODE the value on its own
- It does not allow domain setting
Question 2
IF visibility is not defined for a method /member then it is treated as public static.
- True
- False
Ans: B
Question 3
Which of the following is not a valid php connection status?
- Aborted
- Normal
- Open
- Timeout
Ans: C
Question 4
Which of the following statements is not true with regard to abstract classes in php5?
- Abstract classes are introduced in php 5
- A class with a single abstract method must be declared abstract
- Abstract class can contain abstract methods
- Abstract method must have method definition and can have optional empty braces following it
Question 5What will be the result of following operation?Print 4<<5;
a. 3b. 128c. 120d. 6
Ans: B
Question 6
Which of the following type cast in not correct?
$fig=23;$varbl=(real)$fig;$varb2=(double)$fig;$varb3=(decimal)$fig;$varb4=(bool)$fig;?>
- real
- double
- decimal
- Boolean
Ans: C
Question 7
What is the result of the following expression?
5+2*4+6
- 70
- 19
- 34
- 21
Ans: B
Question 8
The classes are defined as followsAbstract class BaseCls(Protected abstract function getName();}Class childCls extends BaseCls{}Which of the following implementations of getName() in invalid in childCls?
a. Protected function getName(){}b. Function getName(){}c. Private function getName(){}d. Public function getName(){}
Ans: D
Question 9
Multiple select/load is possible with:
- checkbox
- select
- file
- all of the above
Ans : A
Question 10
State whether true or false
Paamayim nekudotayim operator allows access only to the static members of a class?
a. Trueb. False
Ans: A
Question 11
What is the output of the following code?
$a=500;$b=200;echo $a % 2 * $b;?>
- 100
- 200
- 500
- 0
- Syntax error
Ans: D
Question 12
You need to heck the size of a file in php function .$size=X(filename);which function will suitable replace “X”?
- Filesize
- Size
- sizeofFile
- getSize
Ans: A
Question 14Which of the following is not true for a persistent connection?
- these are not closed even after the execution of the script
- these are mainly used to increase the efficiency of the system
- These can’t be converted to non-persistent connections
- These are preferable not used in the scripts involving transactions
Ans: D
Question 15
Which one is correct?
- $s=fwrite(“a string here”);
- $s=fwrite($fp,”a string here”);
- $s=fwrite(“a string here ”,$fp);
- none of the above
Ans B
Question 16Which of the following in not a correct way of printing text in php 5
a. echo “plain text”?>b. c. d. <#echo “plain text”#>
Ans: C
Question 17
Which will be the output of the following code?
$a=0.0;
For($i=0;$i<10;$i++)$a+=0.1;print “$a\n”;if ($a==1.0)print “equals”;elseprint “not equals”;?>
- 0.9
- 1
- 1
- 1.1
Ans: C
Question 18
Which of the following attribute is needed for file upload via form?
- Enc”multipart/form-date”
- Enc”singlepart/date”
- Enc”file”
- Enc”form-data/file”
Ans: A
Question 19
Late php versions support remote file accessing for the functions:
- Include()
- Include_once()
- Require_once()
- All of the above
Ans : D
Question 20
Given below is a small php script:
class person {function getSal(){…………}}class emp extends person {fucniton getSal(){???}}?>the getSal() of emp has to behave exacltyle as getSal() of person . Which of the following lines of code would you use to replace the “???”?
- Parent:: getSal();
- Person::getSal();
- Parent::getsal;
- Person::getSal;
Ans: A
N.B: FOR MORE CONTACT US.........