Pex Software Java Developer Test

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Pexsoftware
P
Pexsoftware
Community Contributor
Quizzes Created: 1 | Total Attempts: 229
Questions: 44 | Attempts: 229

SettingsSettingsSettings
Java Quizzes & Trivia

Questions and Answers
  • 1. 

    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()); }

    • A.

      You can't use continue in a while loop.

    • B.

      Endless loop because it.next() is missing.

    • C.

      Never print anything because allocation is always null.

    • D.

      Allocation.getValue() Could give nullPointerException.

    • E.

      None of these

    Correct Answer
    B. Endless loop because it.next() is missing.
    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.

    Rate this question:

  • 2. 

    JSP.  What is wrong with this statement on a JSP page?<%=session.getAttribute("NominalReportTitle");%> 

    • A.

      You need to delete the ; character

    • B.

      Use

    • C.

      Use

    • D.

      None of them

    Correct Answer
    A. You need to delete the ; character
    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.

    Rate this question:

  • 3. 

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

    • A.

      Forward executes on the server while sendRedirect() executes on the client.

    • B.

      Forward executes on the client while sendRedirect() executes on the server.

    • C.

      The two methods perform identically.

    • D.

      None of these

    Correct Answer
    A. Forward executes on the server while sendRedirect() executes on the client.
    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.

    Rate this question:

  • 4. 

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

    • A.

      Applet

    • B.

      Servlet

    • C.

      Application

    • D.

      Mailet

    Correct Answer
    B. Servlet
    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.

    Rate this question:

  • 5. 

    JSP. What is wrong with the following code ? <%if(strPassword.equals("boss")){< jsp:forward page="Welcome.jsp" flush="true" / >}else{}%>

    • A.

      Unmatched bracket in for statement

    • B.

      Flush attribute must be false

    • C.

      Keyword 'file' should be used instead of 'page' in the action

    • D.

      Actions cannot be used within scriptlet blocks

    Correct Answer
    D. Actions cannot be used within scriptlet blocks
    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.

    Rate this question:

  • 6. 

    JSP. What is wrong with the following code ?<%Cookie c = new Cookie("UserName", "Alastair Gulland");response.addCookie(c);%>

    • A.

      Cookie class can not take parameters in it's constructor

    • B.

      The request object is used for creating cookies

    • C.

      Although no error will be reported the use of the action means that the response object can't be used to create cookies.

    • D.

      The action must be placed inside the script block

    Correct Answer
    C. Although no error will be reported the use of the action means that the response object can't be used to create cookies.
    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.

    Rate this question:

  • 7. 

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

    • A.

      Using the < jsp:readParam /> action

    • B.

      Using the < jsp:getParam /> action

    • C.

      Use the request.getParameter() method

    Correct Answer
    B. Using the < jsp:getParam /> action
    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.

    Rate this question:

  • 8. 

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

    • A.

      The two methods provide the same functionality, but with different levels of persistence.

    • B.

      The forward method is deprecated as of JSP 1.1 and the include method should be used in order to substitute portions of a dynamic display at runtime.

    • C.

      The include method transfers control to a dynamic resource, while the forward method allows for dynamic substitution of another JPS pages output, returning control to the calling resource.

    • D.

      He 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.

    Correct Answer
    D. He 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.
    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.

    Rate this question:

  • 9. 

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

    • A.

      Servlets are built on JSP semantics and all servlets are compiled to JSP pages for runtime usage.

    • B.

      JSP and servlets are unrelated technologies.

    • C.

      Servlets and JSP are competing technologies for handling web requests. Servlets are being superseded by JSP, which is preferred. The two technologies are not useful in combination.

    • D.

      JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage.

    Correct Answer
    D. JSPs are built on servlet semantics and all JSPs are compiled to servlets for runtime usage.
    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.

    Rate this question:

  • 10. 

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

    • A.

      Javax.servlet.*

    • B.

      Java.servlet.*;

    • C.

      Javax.servlet.HttpRequest

    • D.

      Javax.servlet.HttpResponse

    Correct Answer
    A. Javax.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.

    Rate this question:

  • 11. 

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

    • A.

      Objects with session scope are accessible from pages processing requests that are in the same session as the one in which they were created.

    • B.

      It is not legal to define an object with session scope from within a page that is not session-aware.

    • C.

      All references to the object shall be released after the associated session ends.

    • D.

      References to objects with session scope are stored in the session object associated with the page activation.

    • E.

      All above

    Correct Answer
    E. All above
    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.

    Rate this question:

  • 12. 

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

    • A.

      Javax

    • B.

      Java

    • C.

      Java.io

    • D.

      Java.lang

    Correct Answer
    A. Javax
    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.

    Rate this question:

  • 13. 

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

    • A.

      255

    • B.

      225

    • C.

      264

    • D.

      250

    Correct Answer
    A. 255
    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.

    Rate this question:

  • 14. 

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

    • A.

      Can include dynamically generated output.

    • B.

      Provides benefit of automatic recompilation.

    • C.

      Can be used to incorporate contents from static documents

    • D.

      It offers option of sharing local variables and better run time efficiency

    Correct Answer(s)
    A. Can include dynamically generated output.
    B. Provides benefit of automatic recompilation.
    C. Can be used to incorporate contents from static documents
    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.

    Rate this question:

  • 15. 

    JSP. Java Server Pages specification includes (Multiple choice) 

    • A.

      JSP standard directives

    • B.

      JSP standard actions.

    • C.

      Script language declarations, scriplets and expressions.

    • D.

      A portable tag extension mechanism.

    Correct Answer(s)
    A. JSP standard directives
    B. JSP standard actions.
    C. Script language declarations, scriplets and expressions.
    D. A portable tag extension mechanism.
    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.

    Rate this question:

  • 16. 

    JSP. Which of the following correctly defines JSP technology 

    • A.

      JSP page is a text-based document that describes how to process a request to create a response.

    • B.

      JSP page is a text-based document that describes how to process a to response create a request.

    • C.

      JSP page is a xml-based document that describes how to process a request to create a response.

    • D.

      JSP page is a xml-based document that describes how to process a to response create a request.

    Correct Answer
    A. JSP page is a text-based document that describes how to process a request to create a response.
    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.

    Rate this question:

  • 17. 

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

    • A.

      Objects with application scope are accessible from pages processing requests that are in the same application as they one in which they were created.

    • B.

      All references to the object shall be released when the runtime environment reclaims the ServletContext.

    • C.

      Objects with application scope can be defined (and reached) from pages that are not session-aware

    • D.

      References to objects with application scope are stored in the application object associated with a page activation

    Correct Answer(s)
    A. Objects with application scope are accessible from pages processing requests that are in the same application as they one in which they were created.
    B. All references to the object shall be released when the runtime environment reclaims the ServletContext.
    C. Objects with application scope can be defined (and reached) from pages that are not session-aware
    D. References to objects with application scope are stored in the application object associated with a page activation
  • 18. 

    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.

    Correct Answer(s)
    null
    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.

    Rate this question:

  • 19. 

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

    • A.

      A Servlet can handle multiple requests concurrently, and synchronize requests.

    • B.

      Servlet support systems such as online real-time conferencing.

    • C.

      Servlet can forward requests to other servers and Servlet.

    • D.

      Servlet can be used to balance load among several servers that mirror the same content, and to partition a single logical service over xseveral servers, according to task type or organizational boundaries.

    Correct Answer(s)
    A. A Servlet can handle multiple requests concurrently, and synchronize requests.
    B. Servlet support systems such as online real-time conferencing.
    C. Servlet can forward requests to other servers and Servlet.
    D. Servlet can be used to balance load among several servers that mirror the same content, and to partition a single logical service over xseveral servers, according to task type or organizational boundaries.
    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.

    Rate this question:

  • 20. 

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

    • A.

      DoPost()

    • B.

      DoGet()

    • C.

      System.out.println()

    • D.

      System.exit(0);

    Correct Answer
    D. System.exit(0);
    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.

    Rate this question:

  • 21. 

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

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    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.

    Rate this question:

  • 22. 

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

    • A.

      < scripting >

    • B.

      < javascript >

    • C.

      < script >

    • D.

      < js >

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

    Rate this question:

  • 23. 

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

    • A.

      response.write("Hello World")

    • B.

      document.write("Hello World")

    • C.

      ("Hello World")

    • D.

      Echo("Hello World")

    Correct Answer
    B. document.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.

    Rate this question:

  • 24. 

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

    • A.

      Call function myFunction

    • B.

      MyFunction()

    • C.

      Call myFunction()

    Correct Answer
    B. 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.

    Rate this question:

  • 25. 

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

    • A.

      if i==5 then

    • B.

      if i=5 then

    • C.

      if (i==5)

    • D.

      if i=5

    Correct Answer
    C. if (i==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.

    Rate this question:

  • 26. 

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

    • A.

      If (i 5)

    • B.

      If (i != 5)

    • C.

      if =! 5 then

    • D.

      if 5

    Correct Answer
    B. If (i != 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.

    Rate this question:

  • 27. 

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

    • A.

      new("http://www.ex-designz.net","window5")

    • B.

      window.open("http://www.ex-designz.net","window5")

    • C.

      open.newwindow("http://www.ex-designz.net","window5")

    • D.

      new.window("http://www.ex-designz.net","window5")

    Correct Answer
    B. window.open("http://www.ex-designz.net","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.

    Rate this question:

  • 28. 

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

    • A.

      browser.name

    • B.

      navigator.appName

    • C.

      client.navName

    Correct Answer
    B. navigator.appName
    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.

    Rate this question:

  • 29. 

    JAVASCRIPT. Which of the following JavaScript statements use arrays?

    • A.

      setTimeout("a["+i+"]",1000)

    • B.

      k = a & i

    • C.

      k = a(i)

    Correct Answer
    A. setTimeout("a["+i+"]",1000)
    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.

    Rate this question:

  • 30. 

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

    • A.

      Document.getElementById('accountField').value;

    • B.

      Document.getElementById('account').value;

    • C.

      document.getElementById[0].value;

    • D.

      Document.getElementById(accountField).value;

    • E.

      None of them

    Correct Answer
    A. Document.getElementById('accountField').value;
    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.

    Rate this question:

  • 31. 

    JAVASCRIPT. Which one is a correct javascript function declaration?

    • A.

      Function testFunc(){}

    • B.

      Public String testFunc(){}

    • C.

      Function String testFunc() {}

    • D.

      Function x testFunc() {}

    • E.

      None of them

    Correct Answer
    A. Function testFunc(){}
    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.

    Rate this question:

  • 32. 

    LINUX. Which file does Linux use to resolve hostnames?

    • A.

      /etc/hostname.conf

    • B.

      /etc/dns.conf

    • C.

      /etc/host.conf

    • D.

      /etc/resolve.conf

    Correct Answer
    C. /etc/host.conf
    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.

    Rate this question:

  • 33. 

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

    • A.

      666

    • B.

      755

    • C.

      766

    • D.

      777

    Correct Answer
    B. 755
    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.

    Rate this question:

  • 34. 

    LINUX. What is bash?

    • A.

      Something you do to a watermelon

    • B.

      A command to delete multiple files

    • C.

      A network bit format

    • D.

      A command shell

    Correct Answer
    D. A command shell
    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.

    Rate this question:

  • 35. 

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

    • A.

      Lists the settings of the OS

    • B.

      Lists the contents of the directory

    • C.

      List command to list contents of files

    • D.

      Finnish words, means to direct a file to a port

    • E.

      None of the Above

    Correct Answer
    B. Lists the contents of the directory
    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.

    Rate this question:

  • 36. 

    LINUX. Which command creates a file system?

    • A.

      Fdisk

    • B.

      Crfs

    • C.

      Mkfs

    • D.

      Fs

    Correct Answer
    C. Mkfs
    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.

    Rate this question:

  • 37. 

    LINUX. What is the default administrator username?

    • A.

      Administrator

    • B.

      Admin

    • C.

      Superuser

    • D.

      Root

    • E.

      Head

    Correct Answer
    D. Root
    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.

    Rate this question:

  • 38. 

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

    • A.

      * and ?

    • B.

      /

    • C.

      ?

    • D.

      &

    • E.

      Z

    Correct Answer
    A. * and ?
    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.

    Rate this question:

  • 39. 

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

    • A.

      Kill

    • B.

      Stop

    • C.

      End

    • D.

      Wait

    • E.

      CTL-ALT-DEL

    Correct Answer
    A. Kill
    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.

    Rate this question:

  • 40. 

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

    • A.

      Login root

    • B.

      Chuser root

    • C.

      Su

    • D.

      Root

    Correct Answer
    C. Su
    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.

    Rate this question:

  • 41. 

    LINUX. The command "pwd" displays the directory

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    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.

    Rate this question:

  • 42. 

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

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    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.

    Rate this question:

  • 43. 

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

    • A.

      Ma

    • B.

      M$a

    • C.

      M

    • D.

      error message

    Correct Answer
    A. Ma
    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".

    Rate this question:

  • 44. 

    LINUX. How can you extract a zipped tar file?

    • A.

      Tar xfzv file.tar.gz

    • B.

      Tar fzv file.tar.gz

    • C.

      Tar cfzv file.tar.gz

    • D.

      gzip e file.tar.gz

    • E.

      None of them

    Correct Answer
    A. Tar xfzv file.tar.gz
    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".

    Rate this question:

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.