- What are the different kinds of enterprise beans? - Different kind of enterrise beans are Stateless session bean, Stateful session bean, Entity bean, Message-driven bean.
- What is Session Bean? - A session bean is a non-persistent object that implements some business logic running on the server. One way to think of a session object.
- What is Entity Bean? - The entity bean is used to represent data in the database. It provides an object-oriented interface to ____.
- What are the methods of Entity Bean? - An entity bean consists of 4 groups of methods, create methods.
- What is the difference between Container-Managed Persistent (CMP) bean and Bean-Managed Persistent(BMP) ? - Container-managed persistence (CMP) and bean-managed persistence (BMP). With CMP, the container manages the persistence of the entity bean.
- What are the callback methods in Entity beans? - Callback methods allows the container to notify the bean of events in its life cycle. The callback methods are defined in the javax.ejb.EntityBean interface.
- What is software architecture of EJB? - Session and Entity EJBs consist of 4 and 5 parts respectively, a remote interface.
- Can Entity Beans have no create() methods? - Yes. In some cases the data is inserted NOT using Java application,.
- What is bean managed transaction? - If a developer doesn’t want a Container to manage transactions, it’s possible to implement all database operations manually.
- What are transaction attributes? - The transaction attribute specifies how the Container must manage transactions for a method when a client invokes the method via the enterprise bean’s home or.
- What are transaction isolation levels in EJB? - Transaction_read_uncommitted, Transaction_read_committed, Transaction_repeatable_read.
Friday, 7 October 2011
EJB interview questions
Thursday, 6 October 2011
Java Frequently Asked Questions
| What is interface and its use?- Interface is similar to a class which may contain method’s signature only but not bodies and it is a formal set of method and constant declarations that must be defined by the class that implements it. Interfaces are useful for: a)Declaring methods that one or more classes are expected to implement b)Capturing similarities between unrelated classes without forcing a class relationship. c)Determining an object’s programming interface without revealing the actual body of the class. |
| What is an abstract class?- An abstract class is a class designed with implementation gaps for subclasses to fill in and is deliberately incomplete. |
| What is a cloneable interface and how many methods does it contain?- It is not having any method because it is a TAGGED or MARKER interface. |
| Can you have an inner class inside a method and what variables can you access?- Yes, we can have an inner class inside a method and final variables can be accessed. |
| What is multithreading and what are the methods for inter-thread communication and what is the class in which these methods are defined?- Multithreading is the mechanism in which more than one thread run independent of each other within the process. wait (), notify () and notifyAll() methods can be used for inter-thread communication and these methods are in Object class. wait() : When a thread executes a call to wait() method, it surrenders the object lock and enters into a waiting state. notify() or notifyAll() : To remove a thread from the waiting state, some other thread must make a call to notify() or notifyAll() method on the same object |
What are the states associated in the thread?- Thread contains ready, running, waiting and dead states.
What is synchronization?- Synchronization is the mechanism that ensures that only one thread is accessed the resources at a time.
When you will synchronize a piece of your code?- When you expect your code will be accessed by different threads and these threads may change a particular data causing data corruption.
What is deadlock?- When two threads are waiting each other and can’t precede the program is said to be deadlock.
What is daemon thread and which method is used to create the daemon thread?- Daemon thread is a low priority thread which runs intermittently in the back ground doing the garbage collection operation for the java runtime system. setDaemon method is used to create a daemon thread.
Are there any global variables in Java, which can be accessed by other part of your program?- No, it is not the main method in which you define variables. Global variables is not possible because concept of encapsulation is eliminated here.
What is an applet?- Applet is a dynamic and interactive program that runs inside a web page displayed by a java capable browser.
How does applet recognize the height and width?- Using getParameters() method.
When do you use codebase in applet?- When the applet class file is not in the same directory, codebase is used.
What is the lifecycle of an applet?- init() method - Can be called when an applet is first loaded start() method - Can be called each time an applet is started. paint() method - Can be called when the applet is minimized or maximized. stop() method - Can be used when the browser moves off the applet’s page. destroy() method - Can be called when the browser is finished with the applet.
How do you set security in applets?- using setSecurityManager() method
What is an event and what are the models available for event handling?- An event is an event object that describes a state of change in a source. In other words, event occurs when an action is generated, like pressing button, clicking mouse, selecting a list, etc. There are two types of models for handling events and they are: a) event-inheritance model and b) event-delegation model
What are the advantages of the model over the event-inheritance model?- The event-delegation model has two advantages over the event-inheritance model. They are: a)It enables event handling by objects other than the ones that generate the events. This allows a clean separation between a component’s design and its use. b)It performs much better in applications where many events are generated. This performance improvement is due to the fact that the event-delegation model does not have to be repeatedly process unhandled events as is the case of the event-inheritance.
What is source and listener?- source : A source is an object that generates an event. This occurs when the internal state of that object changes in some way. listener : A listener is an object that is notified when an event occurs. It has two major requirements. First, it must have been registered with one or more sources to receive notifications about specific types of events. Second, it must implement methods to receive and process these notifications.
What is adapter class?- An adapter class provides an empty implementation of all methods in an event listener interface. Adapter classes are useful when you want to receive and process only some of the events that are handled by a particular event listener interface. You can define a new class to act listener by extending one of the adapter classes and implementing only those events in which you are interested. For example, the MouseMotionAdapter class has two methods, mouseDragged()and mouseMoved(). The signatures of these empty are exactly as defined in the MouseMotionListener interface. If you are interested in only mouse drag events, then you could simply extend MouseMotionAdapter and implement mouseDragged() .
What is meant by controls and what are different types of controls in AWT?- Controls are components that allow a user to interact with your application and the AWT supports the following types of controls: Labels, Push Buttons, Check Boxes, Choice Lists, Lists, Scrollbars, Text Components. These controls are subclasses of Component.
What is a layout manager and what are different types of layout managers available in java AWT?- A layout manager is an object that is used to organize components in a container. The different layouts are available are FlowLayout, BorderLayout, CardLayout, GridLayout and GridBagLayout.
How are the elements of different layouts organized?- FlowLayout: The elements of a FlowLayout are organized in a top to bottom, left to right fashion. BorderLayout: The elements of a BorderLayout are organized at the borders (North, South, East and West) and the center of a container. CardLayout: The elements of a CardLayout are stacked, on top of the other, like a deck of cards. GridLayout: The elements of a GridLayout are of equal size and are laid out using the square of a grid. GridBagLayout: The elements of a GridBagLayout are organized according to a grid. However, the elements are of different size and may occupy more than one row or column of the grid. In addition, the rows and columns may have different sizes.
Which containers use a Border layout as their default layout?- Window, Frame and Dialog classes use a BorderLayout as their layout.
Monday, 3 October 2011
Interview at IBM
A reader interviewed with IBM and sent the following questions in:
- I have a scale and 7 balls. 1 ball is heavier than all the rest. How do I determine the heaviest ball with only 3 possible weighing attempts?
- What is a linked list?
- Name an advantage of linked list over array?
- Name an advantage of array over linked list?
- Have you ever used threads?
- Should you protect the global data in threads? Why or why not?
- Have you ever interfaced with a database?
- Tell us about yourself.
- Questions about specific resume entries.
- Given two strings like x=”hello” and y=”open”, remove any character from string x which is also used in string y, thus making the result x=”hll”.
Sunday, 2 October 2011
Electrical engineer interview questions
- What types of CMOS memories have you designed? What were their size? Speed? Configuration Process technology?
- What work have you done on full chip Clock and Power distribution? What process technology and budgets were used?
- What types of I/O have you designed? What were their size? Speed? Configuration? Voltage requirements? Process technology? What package was used and how did you model the package/system? What parasitic effects were considered?
- What types of high speed CMOS circuits have you designed?
- What transistor level design tools are you proficient with? What types of designs were they used on?
- What products have you designed which have entered high volume production?
- What was your role in the silicon evaluation/product ramp? What tools did you use?
- If not into production, how far did you follow the design and why did not you see it into production?
07:36
Jegadeesan
