Hibernate and C# Programming Fundamentals

Quiz covering Hibernate ORM framework concepts and C# programming language fundamentals including sessions, queries, collections, inheritance, constructors, and access modifiers

20 Questions Published

Questions

Question 1 Multiple Choice (Multiple Answers)

Which of the following is/are correct about Static method ?

  1. cannot be instantiated
  2. can be called from non static
  3. can be instantiated
  4. 1 & 2
  5. 2 & 3
Question 2 Multiple Choice (Multiple Answers)

What is CLR ?

  1. Conventional Language Runtime
  2. Clarified Language Runtime
  3. Common Language Runtime
  4. Clear Language Runtime
Question 3 Multiple Choice (Multiple Answers)

Which of the following is/are correct about OUT parameter?

  1. Any changes made to the parameter will be reflected in the variable.
  2. The out parameters is used to return values in the same variables, that you pass an an argument of a method
  3. A variable to be sent as OUT parameter must be initialized
  4. 1 & 2
  5. 2 & 3
  6. 1 & 3
Question 4 Multiple Choice (Multiple Answers)

Namespaces can hold

  1. Delegates
  2. Structures
  3. Interfaces
  4. Enumerations
  5. All the above
  6. 2 & 3
Question 5 Multiple Choice (Multiple Answers)

Which of the following is not true about Constructors?

  1. The purpose of constructors is to initialize class members
  2. Constructors can have return values
  3. Constructors always have the same name as the class
  4. None of the above
Question 6 Multiple Choice (Multiple Answers)

public class A{ public A() { Console.WriteLine("A");} } public class B: A { public B(){Console.WriteLine("B"); void print() {Console.WriteLine("Print"); }} public static void Main() { B b = new B(); b.print(); } }

  1. A B print
  2. print
  3. B
  4. B print
  5. print B A
Question 7 Multiple Choice (Multiple Answers)

which of the following is/are true about Polymorphism?

  1. Virtual keyword is used before Base class
  2. Override keyword is used before Derived class
  3. overload keyword is used before Derived class
  4. 1 & 2
  5. 1 & 3
Question 8 Multiple Choice (Multiple Answers)

which of the following is correct?

  1. Structure is a value type and Class is a reference type
  2. Class is a value type and Structure is a reference type
  3. Structs can't have destructors, but classes can have destructors
  4. Class can have implementation inheritance, but Structs cannot have it
  5. Structs can have implementation inheritance, but Class cannot have it
Question 9 Multiple Choice (Multiple Answers)

Interface

  1. has no implementation
  2. only has definitions
  3. must be implemented by class or struct
  4. All the above
  5. 1 & 2
Question 10 Multiple Choice (Single Answer)

who can have access for protected internal Access Modifier?

  1. Either code from derived type or code in the same assembly
  2. Only members within the same type
  3. Only derived types or members of the same type.
  4. Only code within the same assembly
Question 11 Multiple Choice (Single Answer)

Does hibernate allow mixing table-per-class hierarchy and table-per-subclass strategies?

  1. Yes
  2. No
  3. can't say
  4. None of the above
Question 12 Multiple Choice (Single Answer)

Which statement is correct ?

  1. Session.contains() method to determine if an instance belongs to the session cache
  2. Session.contains() method to determine if an instance belongs to the data base
  3. Both are correct
  4. None of the above
Question 13 Multiple Choice (Single Answer)

What does session.evict() method do ?

  1. Remove the object and its collections from the first level cache
  2. Remove the object and its collections from the second level cache
  3. Remove the object and its collections from the data base
  4. None of the above
Question 14 Multiple Choice (Single Answer)

Is the Session threadsafe in Hibernate ?

  1. True
  2. False
  3. No matter
  4. None of the above
Question 15 Multiple Choice (Single Answer)

How can you make a property be read from the database but not modified in anyway

  1. By using the insert="false" and update="false" attributes.
  2. By using the isinsert="false" and isupdate="false" attributes
  3. By using the isinsert="no" and isupdate="no" attributes.
  4. None
Question 16 Multiple Choice (Single Answer)

Which statement is correct ?

  1. A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed
  2. A Session will obtain a JDBC Connection (or a Datasource) on object create
  3. A Session has no relation with JDBC Connection (or a Datasource)
  4. None of the above
Question 17 Multiple Choice (Single Answer)

How to enable query cache in hibernate

  1. Hibernate.cache.query_cache true
  2. Hibernate.cache.use_query_cache true
  3. Hibernate.cache.query_cache yes
  4. None
Question 18 Multiple Choice (Single Answer)

If you are not certain that a matching row exists in the database then which method is the best ?

  1. Session.load();
  2. Session.get();
  3. Session.fetch();
  4. None of the above
Question 19 Multiple Choice (Single Answer)

Which statement is correct?

  1. Bag has index column
  2. Bag permits duplicate element values
  3. Bag does not permits duplicate element values
  4. None
Question 20 Multiple Choice (Single Answer)

What does session.createQuery("Query").scroll() return ?

  1. ListResultSet
  2. ResultSet
  3. ScrollableResultSet
  4. ScrollableResult