Languages-Java [3i Infotech Placement]: Sample Questions 66 - 67 of 141

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 66


Describe in Detail


What is meant by cookies? Explain in the main features?


  • A cookie is a message given to a web browser by a web server.
  • Cookie keeps the state in the otherwise stateless http.
  • The browser stores cookie in a text file.
  • Cookie is sent back with each browser request.
  • Features:
    • Server script sends a cookies to the browser- name, age, or identification number etc.
    • Browser stores this information on local machine for future use.
    • Next time browser sends request with the cookie, server uses that information to identify the user.

Question 67


Appeared in Year: 2004

Write in Short

Short Answer▾

What is thread safe?


  • Thread safe program state behaves correctly when multiple simultaneous threads are using a resource.
  • Term can be applied to a section of code, a method, a class, a library, an application, etc.

    Code is not thread safe when it relies on state not being changed by another thread without guaranteeing that the state cannot be changed by another thread (guaranteeing exclusion) . This can be done by:

    • Ensuring that concurrent threads use synchronized algorithms.
    • Confining the address of a shared object to one thread whenever an unsynchronized algorithm is active.

Developed by: