Pex Software Java Developer Test

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Pexsoftware
P
Pexsoftware
Community Contributor
Quizzes Created: 1 | Total Attempts: 235
| Attempts: 235 | Questions: 44
Please wait...
Question 1 / 44
0 %
0/100
Score 0/100
1. JSP. The wrapper function like 

<%! 
String blanknull(String s) { 
return (s == null) ? "" : s; 

%> 
then use it inside your JSP form, like 
< input type="text" name="shoesize" value="<%=blanknull(shoesize)% >" > 

prevents the word  _______   from apperaring in an HTML page.

Explanation

The wrapper function "blanknull" checks if the input string is null. If it is null, it returns an empty string, otherwise it returns the input string itself. By using this function in the JSP form, specifically in the value attribute of the input tag for the "shoesize" field, it ensures that if the "shoesize" variable is null, the value attribute will be set to an empty string. This prevents the word "null" from appearing in the HTML page.

Submit
Please wait...
About This Quiz
Web Development Quizzes & Trivia

The 'Pex Software Java Developer Test' focuses on assessing Java Server Pages (JSP) knowledge. It evaluates understanding of JSP syntax, server-client interactions, and common pitfalls in JSP coding,... see morepreparing developers for practical web application development tasks. see less

2. JSP. Request.getServerName () is used to get the name of the server on which the Jsp is running

Explanation

The statement is true because the method Request.getServerName() is indeed used to retrieve the name of the server on which the JSP (JavaServer Pages) is currently running. This method returns a string that represents the host name of the server.

Submit
3. JSP. When a JSP page is compiled, what is it turned into ?

Explanation

When a JSP page is compiled, it is turned into a Servlet. JSP (JavaServer Pages) is a technology that allows the creation of dynamic web pages. During the compilation process, the JSP page is translated into a Java Servlet, which is a server-side component that generates dynamic content. The Servlet is then executed by the web server to produce the desired output. Therefore, the correct answer is Servlet.

Submit
4. LINUX. The command "pwd" displays the directory

Explanation

The command "pwd" stands for "print working directory" and when executed in a Linux system, it displays the current directory that the user is in. Therefore, the statement "The command 'pwd' displays the directory" is true.

Submit
5. LINUX. Which of the following are valid Linux wildcards? (Choose the best answer)

Explanation

The valid Linux wildcards are * and ?. The * wildcard represents any number of characters, while the ? wildcard represents a single character. These wildcards are commonly used in Linux command line operations to match multiple files or directories based on specific patterns.

Submit
6. JAVASCRIPT. What is the correct JavaScript syntax to write "Hello World"?

Explanation

The correct JavaScript syntax to write "Hello World" is "document.write("Hello World")". This is because the document.write() function is used to write content directly to the HTML document.

Submit
7. JAVASCRIPT. How do you call a function named "myFunction"?

Explanation

In JavaScript, to call a function named "myFunction", you use the syntax "myFunction()". The parentheses after the function name indicate that you are invoking or calling the function.

Submit
8. JAVASCRIPT. What is the correct JavaScript syntax for opening a new window called "window5" ?

Explanation

The correct JavaScript syntax for opening a new window called "window5" is "window.open("http://www.ex-designz.net","window5")". This syntax uses the "window.open()" method to open a new window with the specified URL and name.

Submit
9. JAVASCRIPT. Inside which HTML element do we put the JavaScript?

Explanation

The correct answer is . This is because JavaScript code is typically placed within tags in an HTML document. These tags are used to define a section of JavaScript code that will be executed by the browser.

Submit
10. LINUX. To move files, use the "move" command.

Explanation

The given statement is false because in Linux, the command used to move files is not "move" but "mv". The "mv" command is used to rename or move files and directories.

Submit
11. Some Operating Systems have a limitation on the Max Length of the URL, which are normally _______ characters.

Explanation

Some operating systems have a limitation on the maximum length of a URL, which is typically 255 characters. This means that URLs longer than 255 characters may not be supported or may cause issues when trying to access a webpage or resource. It is important to be aware of this limitation when designing and working with URLs to ensure compatibility and proper functioning across different operating systems.

Submit
12. LINUX. What is bash?

Explanation

Bash is a command shell in Linux. It is a program that provides a command-line interface for users to interact with the operating system. It allows users to execute commands, run scripts, and manage files and directories. Bash is one of the most commonly used command shells in Linux systems and is known for its powerful features and scripting capabilities.

Submit
13. LINUX. What will be the result of this command: a=a; b=m$a; echo $b;

Explanation

The command "a=a" assigns the value "a" to the variable "a". The command "b=m$a" assigns the value of "a" to the variable "b" with the prefix "m". Finally, the command "echo $b" prints the value of "b", which is "ma".

Submit
14. JAVASCRIPT. How do you write a conditional statement for executing some statements only if "i" is NOT equal to 5?

Explanation

The correct answer is "if (i != 5)". This is the correct conditional statement to execute some statements only if "i" is NOT equal to 5. The "!=" operator is used to check if two values are not equal. In this case, it checks if the value of "i" is not equal to 5. If it is not equal, the statements inside the if block will be executed.

Submit
15. JSP. Calling of which of the following method causes unpredictable results in the Servlet.

Explanation

Calling the method System.exit(0) causes unpredictable results in the Servlet. This method terminates the Java Virtual Machine (JVM) and shuts down the entire application, including the Servlet container. As a result, any ongoing processes or requests handled by the Servlet may be abruptly terminated, leading to unpredictable behavior. It is generally not recommended to use System.exit(0) in a Servlet as it can disrupt the normal functioning of the application.

Submit
16. JSP. The < jsp:include /> action can pass parameters to the page which it is including. How does this second page obtain the
value of these parameters ?

Explanation

The second page obtains the value of the parameters passed by the action by using the action. This action retrieves the value of the specified parameter from the request object and makes it available for use in the second page. The action allows the second page to access and utilize the passed parameters effectively.

Submit
17. JAVASCRIPT. How do you write a conditional statement for executing some statements only if "i" is equal to 5?

Explanation

The correct answer is "if (i==5)". In JavaScript, the conditional statement "if" is used to execute a block of code only if the specified condition is true. In this case, the condition is "i==5", which checks if the value of variable "i" is equal to 5. If the condition is true, the code inside the if statement will be executed.

Submit
18. JAVASCRIPT. How do you get the value of this field< input name="account" id="accountField" value="0001" />

Explanation

The correct answer is "document.getElementById('accountField').value;" because it uses the getElementById method to select the element with the id "accountField" and then retrieves the value of that element.

Submit
19. JSP. What is the key difference between using a < jsp:forward > and HttpServletResponse.sendRedirect()?

Explanation

The key difference between using a and HttpServletResponse.sendRedirect() is that the forward executes on the server while sendRedirect() executes on the client. This means that when using , the server handles the redirection internally without involving the client, while with sendRedirect(), the server sends a response to the client with a new URL, and the client then initiates a new request to that URL.

Submit
20. JSP. What is wrong with the following code ?

<%
Cookie c = new Cookie("UserName", "Alastair Gulland");
response.addCookie(c);
%>

Explanation

The use of the `` action in the code indicates that it is written in JSP scriptlet. However, the correct way to create cookies in JSP is by using the `` action. So, although no error will be reported, the use of the `` action means that the response object cannot be used to create cookies.

Submit
21. LINUX. A user is logged into the Linux workstation, what is the best way to login to root from a shell prompt?

Explanation

The best way to login to root from a shell prompt in Linux is by using the "su" command. This command stands for "switch user" and allows the user to switch to the root user account without logging out. By typing "su" followed by the root password, the user gains administrative privileges and can perform tasks that require root access.

Submit
22. JSP. Which packages in the java provide the writing of the Servlet

Explanation

The correct answer is javax because the javax package in Java provides classes and interfaces for writing servlets. Servlets are Java programs that run on a web server and handle client requests and server responses. The javax.servlet package, which is part of the javax package, contains the necessary classes and interfaces for creating and managing servlets. Therefore, javax is the correct answer as it specifically refers to the package that enables the writing of servlets in Java.

Submit
23. LINUX. Which file does Linux use to resolve hostnames?

Explanation

Linux uses the /etc/host.conf file to resolve hostnames. This file contains configuration information for the resolver library, which is responsible for resolving domain names to IP addresses. The /etc/host.conf file specifies the order in which the resolver library should query different sources for hostname resolution, such as DNS servers or the local hosts file. By configuring this file, administrators can control how Linux resolves hostnames and customize the resolution process according to their needs.

Submit
24. LINUX. From a command prompt, what does the command "ls" do?

Explanation

The command "ls" in Linux is used to list the contents of a directory. It displays the files and directories present in the current working directory. This command is commonly used to navigate and explore the file system in Linux.

Submit
25. JSP.  What is wrong with this statement on a JSP page?

<%=session.getAttribute("NominalReportTitle");%>
 

Explanation

The statement on the JSP page is incorrect because it includes a semicolon character (;) at the end. In JSP, the semicolon is not required at the end of an expression. Therefore, to fix the statement, the semicolon should be deleted.

Submit
26. JSP. Choose the statement that best describes the relationship between JSP and servlets:

Explanation

JSPs (JavaServer Pages) are built on servlet semantics, meaning they are designed to be a higher-level abstraction of servlets. JSPs are compiled into servlets before they are executed, allowing them to take advantage of the powerful features provided by servlets. This relationship between JSP and servlets allows developers to write dynamic web pages using the simplicity and ease of JSP syntax, while still leveraging the functionality and flexibility of servlets. Therefore, the correct answer is that JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage.

Submit
27. JSP. What is wrong with the following code ? 

<%
if(strPassword.equals("boss"))
{
< jsp:forward page="Welcome.jsp" flush="true" / >
}
else
{
}
%>

Explanation

The given code is incorrect because actions, such as jsp:forward, cannot be used within scriptlet blocks. In this code, the jsp:forward action is being used within the scriptlet block, which is not allowed. Actions should be used outside of the scriptlet block.

Submit
28. JSP. Which jar file should be mandatory be there in the CLASSPATH for working with Servlet.

Explanation

The correct answer is javax.servlet.*. This is because the javax.servlet package contains the necessary classes and interfaces for working with servlets, such as HttpServletRequest and HttpServletResponse. By including javax.servlet.* in the CLASSPATH, the necessary dependencies will be available for the servlet to function properly.

Submit
29. JSP. Which of the following statements is true regarding the scope of the ‘session’ in JSP?

Explanation

The given correct answer states that all the statements regarding the scope of the 'session' in JSP are true. According to the answer, objects with session scope can be accessed from pages processing requests in the same session, it is not legal to define an object with session scope from a non-session-aware page, all references to the object are released after the session ends, and references to objects with session scope are stored in the session object associated with the page activation. Therefore, all of the above statements are true regarding the scope of the 'session' in JSP.

Submit
30. JAVASCRIPT. Which of the following JavaScript statements use arrays?

Explanation

The correct answer is setTimeout("a["+i+"]",1000). This statement uses an array by accessing the element at index 'i' in the array 'a'. The setTimeout function allows for a delay of 1000 milliseconds before executing the code inside the quotation marks. In this case, the code is accessing an element in the array 'a' using the value of 'i' as the index.

Submit
31. LINUX. You are working in Linux when a program hits a flaw and stops running. Which command can be used to end the process?

Explanation

The correct answer is "kill". In Linux, the "kill" command is used to terminate a process. When a program hits a flaw and stops running, using the "kill" command allows you to forcefully end the process. This command sends a signal to the specified process, instructing it to terminate. By using the "kill" command followed by the process ID, you can effectively stop a program that is not responding or causing issues.

Submit
32. LINUX. What is the default administrator username?

Explanation

The default administrator username in Linux is "root". This is because "root" is the superuser account that has complete control over the system. It has the highest level of privileges and can perform any task on the system, including managing users, installing software, and modifying system files. Other options like "administrator", "admin", "superuser", and "head" are not the default administrator usernames in Linux.

Submit
33. JAVASCRIPT. How do you find the client's browser name?

Explanation

The client's browser name can be found using the "navigator.appName" property in JavaScript. This property returns the name of the browser that the client is using. Therefore, "navigator.appName" is the correct answer to find the client's browser name.

Submit
34. LINUX. Which command creates a file system?

Explanation

The command "mkfs" is used in Linux to create a file system on a storage device or partition. It is commonly used to format a newly created partition or to reformat an existing one with a different file system type. This command initializes the file system metadata and structures, making the storage device ready for use. Therefore, "mkfs" is the correct command to create a file system in Linux.

Submit
35. JSP. Which of the following correctly defines JSP technology 

Explanation

The correct answer is "JSP page is a text-based document that describes how to process a request to create a response." This answer accurately defines JSP technology by stating that a JSP page is a text-based document that provides instructions on how to process a request and generate a response. This aligns with the purpose of JSP, which is to dynamically generate web content by combining HTML, XML, and Java code.

Submit
36. LINUX. What are the file attributes for executing Perl programs?

Explanation

The file attributes for executing Perl programs are 755. This means that the owner of the file has read, write, and execute permissions, while the group and others have only read and execute permissions. This allows the owner to execute the Perl program, while others can only read and execute it.

Submit
37. JAVASCRIPT. Which one is a correct javascript function declaration?

Explanation

The correct javascript function declaration is "function testFunc(){}".br> This is the correct syntax for declaring a function in JavaScript. The keyword "function" is followed by the name of the function (testFunc in this case), and then a pair of parentheses and curly braces. Any code that needs to be executed when the function is called is placed inside the curly braces.

Submit
38. LINUX. How can you extract a zipped tar file?

Explanation

The correct answer is "tar xfzv file.tar.gz". This command extracts a zipped tar file by using the "tar" command with the options "x" (extract), "f" (file), "z" (gzip compression), and "v" (verbose mode). It specifies the file to be extracted as "file.tar.gz".

Submit
39. JSP. What is wrong with this code?

AccountingAllocation allocation = new AccountingAllocation("001"); 
it = allocatedFrom.iterator();
while (it.hasNext()) {
       if (allocation == null) continue;
       System.out.println("Value = " + allocation.getValue());
 }

Explanation

The code provided creates an instance of the AccountingAllocation class and assigns it to the "allocation" variable. Then, it initializes an iterator called "it" using the allocatedFrom collection. The while loop checks if the iterator has a next element, and if so, it prints the value of the "allocation" variable. However, the code does not call the "it.next()" method inside the loop, which means the iterator will always point to the same element, causing an endless loop.

Submit
40. JSP. What is the difference between doing an include or a forward with a RequestDispatcher ?

Explanation

The explanation provided correctly states that the forward method transfers control to the designated resource, while the include method invokes the designated resource, substitutes its output dynamically in the display, and returns control to the calling page. This means that when using the forward method, the control is completely transferred to the new resource, whereas when using the include method, the output of the new resource is included in the current display and the control is returned to the calling page.

Submit
41. JSP. Which of the following points is true regarding the general and selling point of Servlet (Multiple choice)

Explanation

Servlets are Java-based server-side components that can handle multiple requests concurrently and synchronize requests. They also support systems such as online real-time conferencing. Additionally, servlets have the ability to forward requests to other servers and servlets. They can also be used to balance the load among several servers that mirror the same content and partition a single logical service over several servers based on task type or organizational boundaries.

Submit
42. JSP. Which of the following statements is true about the scope of ‘application’ in JSP ?

Explanation

not-available-via-ai

Submit
43. JSP. Java Server Pages specification includes (Multiple choice) 

Explanation

The correct answer includes all the components of the JSP specification. JSP standard directives are used to define page settings and import classes, JSP standard actions are used to perform specific tasks, script language declarations, scriplets, and expressions are used to embed Java code in the JSP page, and a portable tag extension mechanism allows for the creation of custom tags.

Submit
44. JSP. Which of the following statement is true for the tag. (Multiple choice) 

Explanation

The given correct answer is a combination of three statements that are true for the JSP tag. The first statement, "Can include dynamically generated output," means that JSP allows for the inclusion of dynamic content within the page. The second statement, "Provides benefit of automatic recompilation," implies that JSP pages are automatically recompiled when changes are made, saving time and effort. The third statement, "Can be used to incorporate contents from static documents," suggests that JSP can include static content from other documents, enhancing the flexibility of the page.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 20, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 07, 2010
    Quiz Created by
    Pexsoftware
Cancel
  • All
    All (44)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
JSP. The wrapper function like <%! String...
JSP. Request.getServerName () is used to get the name of the server on...
JSP. When a JSP page is compiled, what is it turned into ?
LINUX. The command "pwd" displays the directory
LINUX. Which of the following are valid Linux wildcards? (Choose...
JAVASCRIPT. What is the correct JavaScript syntax to write "Hello...
JAVASCRIPT. How do you call a function named "myFunction"?
JAVASCRIPT. What is the correct JavaScript syntax for opening a...
JAVASCRIPT. Inside which HTML element do we put the JavaScript?
LINUX. To move files, use the "move" command.
Some Operating Systems have a limitation on the Max Length of the URL,...
LINUX. What is bash?
LINUX. What will be the result of this command: a=a; b=m$a; echo...
JAVASCRIPT. How do you write a conditional statement for...
JSP. Calling of which of the following method causes...
JSP. The < jsp:include /> action can pass parameters to the...
JAVASCRIPT. How do you write a conditional statement for...
JAVASCRIPT. How do you get the value of this field< input...
JSP. What is the key difference between using a < jsp:forward...
JSP. What is wrong with the following code ?<%Cookie c = new...
LINUX. A user is logged into the Linux workstation, what is the...
JSP. Which packages in the java provide the writing of the...
LINUX. Which file does Linux use to resolve hostnames?
LINUX. From a command prompt, what does the command "ls" do?
JSP.  What is wrong with this statement on a JSP...
JSP. Choose the statement that best describes the relationship...
JSP. What is wrong with the following code...
JSP. Which jar file should be mandatory be there in the CLASSPATH...
JSP. Which of the following statements is true regarding the...
JAVASCRIPT. Which of the following JavaScript statements use...
LINUX. You are working in Linux when a program hits a flaw and...
LINUX. What is the default administrator username?
JAVASCRIPT. How do you find the client's browser name?
LINUX. Which command creates a file system?
JSP. Which of the following correctly defines JSP...
LINUX. What are the file attributes for executing Perl programs?
JAVASCRIPT. Which one is a correct javascript function declaration?
LINUX. How can you extract a zipped tar file?
JSP. What is wrong with this code?AccountingAllocation allocation...
JSP. What is the difference between doing an include or a forward...
JSP. Which of the following points is true regarding the general...
JSP. Which of the following statements is true about the scope of...
JSP. Java Server Pages specification includes (Multiple...
JSP. Which of the following statement is true for the tag....
Alert!

Advertisement