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
Questions
Which of the following is/are correct about Static method ?
- cannot be instantiated
- can be called from non static
- can be instantiated
- 1 & 2
- 2 & 3
What is CLR ?
- Conventional Language Runtime
- Clarified Language Runtime
- Common Language Runtime
- Clear Language Runtime
Which of the following is/are correct about OUT parameter?
- Any changes made to the parameter will be reflected in the variable.
- The out parameters is used to return values in the same variables, that you pass an an argument of a method
- A variable to be sent as OUT parameter must be initialized
- 1 & 2
- 2 & 3
- 1 & 3
Namespaces can hold
- Delegates
- Structures
- Interfaces
- Enumerations
- All the above
- 2 & 3
Which of the following is not true about Constructors?
- The purpose of constructors is to initialize class members
- Constructors can have return values
- Constructors always have the same name as the class
- None of the above
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(); } }
- A B print
- print
- B
- B print
- print B A
which of the following is/are true about Polymorphism?
- Virtual keyword is used before Base class
- Override keyword is used before Derived class
- overload keyword is used before Derived class
- 1 & 2
- 1 & 3
which of the following is correct?
- Structure is a value type and Class is a reference type
- Class is a value type and Structure is a reference type
- Structs can't have destructors, but classes can have destructors
- Class can have implementation inheritance, but Structs cannot have it
- Structs can have implementation inheritance, but Class cannot have it
Interface
- has no implementation
- only has definitions
- must be implemented by class or struct
- All the above
- 1 & 2
who can have access for protected internal Access Modifier?
- Either code from derived type or code in the same assembly
- Only members within the same type
- Only derived types or members of the same type.
- Only code within the same assembly
Does hibernate allow mixing table-per-class hierarchy and table-per-subclass strategies?
- Yes
- No
- can't say
- None of the above
Which statement is correct ?
- Session.contains() method to determine if an instance belongs to the session cache
- Session.contains() method to determine if an instance belongs to the data base
- Both are correct
- None of the above
What does session.evict() method do ?
- Remove the object and its collections from the first level cache
- Remove the object and its collections from the second level cache
- Remove the object and its collections from the data base
- None of the above
Is the Session threadsafe in Hibernate ?
- True
- False
- No matter
- None of the above
How can you make a property be read from the database but not modified in anyway
- By using the insert="false" and update="false" attributes.
- By using the isinsert="false" and isupdate="false" attributes
- By using the isinsert="no" and isupdate="no" attributes.
- None
Which statement is correct ?
- A Session will not obtain a JDBC Connection (or a Datasource) unless it is needed
- A Session will obtain a JDBC Connection (or a Datasource) on object create
- A Session has no relation with JDBC Connection (or a Datasource)
- None of the above
How to enable query cache in hibernate
- Hibernate.cache.query_cache true
- Hibernate.cache.use_query_cache true
- Hibernate.cache.query_cache yes
- None
If you are not certain that a matching row exists in the database then which method is the best ?
- Session.load();
- Session.get();
- Session.fetch();
- None of the above
Which statement is correct?
- Bag has index column
- Bag permits duplicate element values
- Bag does not permits duplicate element values
- None
What does session.createQuery("Query").scroll() return ?
- ListResultSet
- ResultSet
- ScrollableResultSet
- ScrollableResult