Tag: programming languages

Questions Related to programming languages

  1. a) National File System

  2. b) Network Flashmemory System

  3. c) Network File System

  4. d) Network Fault System


Correct Option: C
  1. create tables automatically

  2. b) create session object automatically

  3. c) create Session Factory object automatically

  4. d) None


Correct Option: A
  1. a) Use getmemory()

  2. b) Use sysctl()

  3. c) Use freemem()

  4. d) Use malloc()


Correct Option: B
  1. a) By mapping the property with access="onlyfield" in Hibernate metadata

  2. b) By mapping the property with access="variable" in Hibernate metadata

  3. c) By mapping the property with access="field" in Hibernate metadata

  4. d) none of the above


Correct Option: C
  1. a) Use getmemory()

  2. b) Use sysctl()

  3. c) Use freemem()

  4. d) Use malloc()


Correct Option: B
  1. a) On session close session.load() Emp Object unavailable to access

  2. b) On session close session.createCriteria() Emp unavailable to access

  3. c) None

  4. Both a & b


Correct Option: A
Explanation:

To understand the difference between session.load(Emp.class) and session.createCriteria(Emp.class), the user needs to know about Hibernate, an ORM (Object-Relational Mapping) framework that provides a way to map Java objects to database tables.

session.load(Emp.class) and session.createCriteria(Emp.class) are two different ways to retrieve data from the database using Hibernate.

session.load(Emp.class) is used to load an object from the database using its identifier. It returns a proxy object of the requested entity and the actual database query is executed only when the proxy object is accessed for the first time. If the identifier is not found in the database, then it throws the ObjectNotFoundException exception.

On the other hand, session.createCriteria(Emp.class) is used to create a Criteria object that can be used to retrieve data from the database. It provides a way to construct a query using a set of criteria such as restrictions, projections, and ordering. It returns a list of objects that match the criteria specified in the query.

Now let's go through each option and explain why it is right or wrong:

A. a) On session close session.load() Emp Object unavailable to access: This option is partially correct. When the session is closed before accessing the Emp object loaded using session.load(), then the ObjectNotFoundException exception is thrown. However, the Emp object is still available to access until the session is closed.

B. b) On session close session.createCriteria() Emp unavailable to access: This option is incorrect. When the session is closed before accessing the Emp object retrieved using session.createCriteria(), then the LazyInitializationException exception is thrown. However, the Emp object is still available to access until the session is closed.

C. c) None: This option is incorrect. There is a difference between session.load() and session.createCriteria() as explained above.

D. Both a & b: This option is incorrect. Option A is partially correct and option B is incorrect.

Therefore, the correct answer is:

The Answer is: A

  1. a) A port to connect printer

  2. b) A port to connect keyboard

  3. c) An abstraction to pass data across processes

  4. d) A hardware device


Correct Option: C
  1. a) A printer queue

  2. b) An IPC mechanism with destructive execute

  3. c) An IPC mechanism with destructive write

  4. d) An IPC mechanism with destructive read


Correct Option: D
  1. a) A printer thread

  2. b) A POSIX standard thread to support multi-tasking

  3. c) A POSIX standard thread to support multi-threading

  4. d) A POSIX standard thread to support kernel debugging


Correct Option: C