Sie sind auf Seite 1von 8

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.

com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Delphi Technical Latest Sample Placement Paper


1. How are the wait/signal operations for monitor different from those for semaphores? ANS: If a process in a monitor signal and no task is waiting on the condition variable, the signal is lost. So this allows easier program design. Whereas in semaphores, every operation affects the value of the semaphore, so the wait and signal operations should be perfectly balanced in the program. 2. How do I create a subscript operator for a Matrix class? ANS: Use operator () rather than operator []. When you have multiple subscripts, the cleanest way to do it is with operator () rather than with operator []. The reason is that operator [] always takes exactly one parameter, but operator () can take any number of parameters (in the case of a rectangular matrix, two parameters are needed). For example: class Matrix { public: Matrix(unsigned rows, unsigned cols); double& operator() (unsigned row, unsigned col); subscript operators often come in pairs double operator() (unsigned row, unsigned col) const; subscript operators often come in pairs ... ~Matrix(); // Destructor Matrix(const Matrix& m); // Copy constructor Matrix& operator= (const Matrix& m); // Assignment operator ... private: unsigned rows_, cols_; double* data_; };
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

inline Matrix::Matrix(unsigned rows, unsigned cols) : rows_ (rows) , cols_ (cols) //data_ <--initialized below (after the 'if/throw' statement) { if (rows == 0 || cols == 0) throw BadIndex("Matrix constructor has 0 size"); data_ = new double[rows * cols]; } inline Matrix::~Matrix() { delete[] data_; } inline double& Matrix::operator() (unsigned row, unsigned col) { if (row >= rows_ || col >= cols_) throw BadIndex("Matrix subscript out of bounds"); return data_[cols_*row + col]; } inline double Matrix::operator() (unsigned row, unsigned col) const { if (row >= rows_ || col >= cols_) throw BadIndex("const Matrix subscript out of bounds"); return data_[cols_*row + col]; } Then you can access an element of Matrix m using m(i,j) rather than m[i][j]:
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

int main() { Matrix m(10,10); m(5,8) = 106.15; std::cout << m(5,8); ... } 3. Does importing a package imports the subpackages as well? E.g. Does importing com.MyTest.* Also import com.MyTest.UnitTests.*? ANS: No you will have to import the subpackages explicitly. Importing com.MyTest.* will import classes in the package MyTest only. It will not import any class in any of its subpackage. 4. What is the benefit of wrapping database calls into MTS transactions? ANS: If database calls are made within the context of a transaction, aborting the transaction will undo and changes that occur within that transaction. This removes the possibility of stranded or partial data. 5. What is the default value of an object reference declared as an instance variable? ANS: Null unless we define it explicitly. 6. What is Inprocess and Out of Process? ANS: Inprocess It will run with in the memory. (Local Machine). Out of Process It will run out of the memory Normally in the server side. 7. What type of parameter passing does Java support? ANS: In Java the arguments are always passed by value. 8. Suppose from form1 to form2 object property settings will arise to? ANS: Invalid procedure call or argument (Run time error 5) 9. What are the different types of Dialog Box? ANS: Predefined, Custom, User Defined.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

10. What is Zorder Method? ANS: Object.Zorder = 1 or 0 Place a Specified mdiform form or control at the front or back of the z-order with n its Graphical Level. 11. How can I customize the serialization process? I.e. how can one have a control over the serialization process? ANS: Yes it is possible to have control over serialization process. The class should implement Externalizable interface. This interface contains two methods namely readExternal and writeExternal. You should implement these methods and write the logic for customizing the serialization process. 12. What is the different between Microsoft ODBC Driver and Oracle OBDC Driver? ANS: Microsoft ODBC driver will support all the methods and properties of Visual Basic. Whereas the Oracle not. 13. What is the common usage of serialization? ANS: Whenever an object is to be sent over the network, objects need to be serialized. Moreover if the state of an object is to be saved, objects need to be serialized. 14. How do I serialize an object to a file? ANS: The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the ObjectOutputStream which is connected to a fileoutputstream. This will save the object to a file. 15. What one should take care of while serializing the object? ANS: One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a NotSerializableException. 16. What if I write static public void instead of public static void? ANS: Program compiles and runs properly.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

17. What if the static modifier is removed from the signature of the main method? ANS: Program compiles. But at runtime throws an error NoSuchMethodError. 18. What is the diff between RDO and ADO? ANS: RDO is Hierarchy model whereas ADO is Object model. ADO can access data from both flat files as well as the data bases. I.e., It is encapsulation of DAO, RDO and OLE that is why we call it as OLE-DB Technology. 19. Have you create Properties and Methods for your own Controls? ANS: Properties Public variable of a Class & Method Public procedure of a class. 20. How to change the Mouse Pointer? ANS: Screen.MousePointer = VBHourGlass/VBNormal. 21. What if I do not provide the String array as the argument to the method? ANS: Program compiles but throws a runtime error NoSuchMethodError. 22. What is the difference between Property Get, Set and Let? ANS: Set Value is assigned to ActiveX Object from the form. Let Value is retried to ActiveX Object from the form. Get- Assigns the value of an expression to a variable or property. 23. How can one prove that the array is not null but empty? ANS: Print args.length. It will print 0. That means it is empty. But if it would have been null then it would have thrown a NullPointerException on attempting to print args.length. 24. What are the Style properties of List Box? ANS: Simple Single Select, Extended. Multiple Select.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

25. What environment variables do I need to set on my machine in order to be able to run Java programs? ANS: CLASSPATH and PATH are the two variables. 26. What is Collection Objects? ANS: Similarly to arrays but is preferred over an array because of the following reasons. 1. A collection objects uses less Memory than an array. 2. It provides methods to add and delete members. 3. It does not required reason statement when objects are added or deleted. 4. It does not have boundary limitations. 27. Can an application have multiple classes having main method? ANS: Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name you have mentioned. Hence there is not conflict amongst the multiple classes having main method. 28. In project properties if we set Unattended what is it mean? ANS: This cannot have user interface. This can be used for the COM creation. 29. What are Checked and UnChecked Exception? ANS: A checked exception is some subclass of Exception (or Exception itself), excluding class RuntimeException and its subclasses. Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. e.g., IOException thrown by java.io.FileInputStreams read () method. Checked exceptions are RuntimeException and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesnt force client programmers either to catch the exception or declare it in a throws clause. In fact,
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

client programmers may not even know that the exception could be thrown. e.g., StringIndexOutOfBoundsException thrown by Strings charAt () method Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be. 30. Handling Error in Calling chain. ANS: This will call the top most error where the error is handled. 31. What is a Cartesian product in PL/SQL? ANS: When a Join condition is not specified by the programmer or is invalid (fails), PL/SQL forms a Cartesian product. In a Cartesian product, all combinations of rows will be displayed. For example, All rows in the first table are joined to all rows in the second table. It joins a bunch of rows and its result is rarely useful unless you have a need to combine all rows from all tables. 32. Why we use Treeview Control? ANS: To list the hierarchical list of the node objects. Such of files and Directories. 33. What is the purpose of garbage collection in Java, and when is it used? ANS: The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. 34. What is view Port? ANS: The area under which the container provides the view of the ActiveX Document is known as a view port. 35. What are the Style Properties of Combo Box? ANS: Simple, Dropdown list We can type and select. Dropdown Combo Only Drop Down.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

36. What is Mixed Cursors? ANS: Static + Keyset. 37. What is HashMap and Map? ANS: Map is Interface and Hashmap is class that implements that. 38. Describe synchronization in respect to multithreading? ANS: With respect to multithreading, synchronization is the capability to control the access of multiple threads to shared resources. Without synchronization, it is possible for one thread to modify a shared variable while another thread is in the process of using or updating same shared variable. This usually leads to significant errors. 39. Difference between HashMap and HashTable? ANS: The HashMap class is roughly equivalent to Hashtable, except that it is unsynchronized and permits nulls. (HashMap allows null values as key and value whereas Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is non-synchronized and Hashtable is synchronized. 40. Drag and Drop state numbers and functions? ANS: State 0 Source control is being dragged with the range of a target. 1 Out of the range of a target. 2 One position in the target to another.

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail http://groups.google.com/group/latestoffcampus/subscribeLive updates on Facebook @ www.facebook.com/LatestOffCampus

Das könnte Ihnen auch gefallen