PHP and JSP Web Technologies
Test your knowledge of PHP and JSP/Java web server technologies including operators, arrays, database connections, JSP directives, implicit objects, and JavaBeans.
Questions
JSP expressions should be enclosed within
- <% %>
- <%= %>
- <%! %>
- <!-- -->
Predefined variables are also called as
- scriptlets
- declarations
- implicit objects
- expressions
The following is not an implicit object
- out
- response
- session
- page
Following is a type of JSP directives
- page
- include
- taglib
- all the above
The number of page directives
- 8
- 12
- 16
- 9
The only page directive that can be used a number of times in a jsp is
- extends
- session
- import
- language
The following is not a feature of java beans
- directives
- properties
- methods
- events
A Bean class
- must have empty constructor
- should have no public fields
- Both a and b
- None of a and b
The number of JSP action tags
- 2
- 3
- 4
- 5
TLD is
- Tag Library Descriptor
- Tag Language Description
- Tag Library Description
- Tag Language Dynamics
package polymorphism;class TestPolymorphismSuper { int p; TestPolymorphismSuper testPoly() { TestPolymorphismSuper TS = new TestPolymorphismSuper(); TS.p =100; return TS; }}public class TestPolymorphism1 extends TestPolymorphismSuper{ TestPolymorphism1 testPoly() { TestPolymorphism1 TSub = new TestPolymorphism1(); TSub.p =500; return TSub; } public static void main(String[] args) { TestPolymorphismSuper TSuper = new TestPolymorphism1(); TSuper = TSuper.testPoly(); System.out.println(TSuper.p); }}
- 500
- 100
- 0
- Null Pointer Exception
Which PHP function do you use to connect to a mysql database.
- mysql_selectDB_server($server,$user,$password)
- mysql_connection($server,$user,$password)
- mysql_connect($server,$user,$password)
- database_connect($mysql,$server,$user,$password,$database)
Which is the correct way to call an object method?
- $object.method()
- $object->$method()
- $object:$method()
- $object->method()
Which is the problem with the following code using PHP5?
- Object attributes are not of any specific data type
- The constructor of the class is not correctly defined
- You cannot put an equal when recieving a parameter in the constructor
- The word function is missing before the class constructor
Which is the final value of $n?
- 36
- 30
- 33
- 25
Which is the function, besides join(), that you use to join array elements with a string?
- strconcat(string $glue, array $pieces)
- implode ( string $glue , array $pieces )
- strcmp(array $pieces, string $concat, int $elementNumber)
- arrayConcat(array $pieces, string $concat, string $EOF)
Which logical operators are allowed in PHP?
- &&
- and
- nxor
- ||
Which of these are valid array operators in php?
- ==
- ===
- +
- union
Which of the following are valid bitwise operators in php?
- ^
- |||
- >>
- ~
If you want to create an associative array in php5, which is the correct manner?
- $var = new asoc_array("key"->"value","key2"->"value2");
- $var = array("key"=>"value","key2"=>"value2");
- $var = new ArrayList("key,value","key1,value1");
- $var = new List(Of Associative)["key"=>"value","key1","value1"];