Search Interview Questions | ![]() ![]() Click here and help us by providing the answer. ![]() Click Correct / Improve and please let us know. |
|
| ||||
Interview Questions and Answers - Order By Newest | ||||
![]() ![]() | ||||
| ||||
Ans. Swing provides both additional components like JTable, JTree etc and added functionality to AWT-replacement components. Swing components can change their appearance based on the current “look and feel†library that’s being used. Swing components follow the MVC paradigm, and thus can provide a much more flexible UI. Swing provides extras for components, such as icons on many components, decorative borders for components, tool tips for components etc. Swing components are lightweight than AWT. Swing provides built-in double buffering ,which means an off-screen buffer is used during drawing and then the resulting bits are copied onto the screen. Swing provides paint debugging support for when you build your own component. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. public void init() public void start() public void stop() public void destroy() | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. JProbe, OptimizeIt | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. J2EE or Java 2 Enterprise Edition is an environment for developing and deploying enterprise applications. The J2EE platform consists of J2EE components, services, Application Programming Interfaces (APIs) and protocols that provide the functionality for developing multi-tiered and distributed Web based applications. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Its the process of creating XML structures out of Java Objects which is used to traverse information across the network. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Its the process of creating Java Objects out of XML structures. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. LDAP servers are typically used in J2EE applications to authenticate and authorise users. LDAP servers are hierarchical and are optimized for read access, so likely to be faster than database in providing read access. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Translation of JSP PageCompilation of JSP PageClassloading (class file is loaded by the classloader)Instantiation (Object of the Generated Servlet is created).Initialization ( jspInit() method is invoked by the container).Reqeust processing ( _jspService() method is invoked by the container).Destroy ( jspDestroy() method is invoked by the container). | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. The jsp directives are messages that tells the web container how to translate a JSP page into the corresponding servlet. There are three types of directives - page directive include directive taglib directive | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. In GUI programming, an object that can be registered to be notified when events of some given type occur. The object is said to listener? for the events. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. We are initializing a static and constant string array named as COLORS using Strings "Red","Green" and "Blue". | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. A way of encoding characters as binary numbers. The Unicode character set includes characters used in many languages, not just English. Unicode is the character set that is used internally by Java. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. ThreadFactory is an interface that is meant for creating threads instead of explicitly creating threads by calling new Thread(). Its an object that creates new threads on demand. Using thread factories removes hardwiring of calls to new Thread, enabling applications to use special thread subclasses, priorities, etc. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. You can put related classes together as a single logical group. Nested classes can access all class members of the enclosing class, which might be useful in certain cases. Nested classes are sometimes useful for specific purposes. For example, anonymous inner classes are useful for writing simpler event-handling code with AWT/Swing. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. The accessibility (public, protected, etc.) of the static nested class is defined by the outer class. A static nested class is not an inner class, it's a top-level nested class. The name of the static nested class is expressed with OuterClassName.NestedClassName syntax. When you define an inner nested class (or interface) inside an interface, the nested class is declared implicitly public and static. Static nested classes can be declared abstract or final. Static nested classes can extend another class or it can be used as a base class. Static nested classes can have static members. Static nested classes can access the members of the outer class (only static members, obviously). The outer class can also access the members (even private members) of the nested class through an object of nested class. If you don't declare an instance of the nested class, the outer class cannot access nested class elements directly. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. The accessibility (public, protected, etc.) of the inner class is defined by the outer class. Just like top-level classes, an inner class can extend a class or can implement interfaces. Similarly, an inner class can be extended by other classes, and an inner interface can be implemented or extended by other classes or interfaces. An inner class can be declared final or abstract.Inner classes can have inner classes, but you will have a hard time reading or understanding such complex nesting of classes. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
![]() | ||||
| ||||
Ans. You can create a non-static local class inside a body of code. Interfaces cannot have local classes, and you cannot create local interfaces. Local classes are accessible only from the body of the code in which the class is defined. The local classes are completely inaccessible outside the body of the code in which the class is defined. You can extend a class or implement interfaces while defining a local class. A local class can access all the variables available in the body of the code in which it is defined. You can pass only final variables to a local inner class. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Anonymous classes are defined in the new expression itself, so you cannot create multiple objects of an anonymous class. You cannot explicitly extend a class or explicitly implement interfaces when defining an anonymous class. An anonymous inner class is always created as part of a statement; don't forget to close the statement after the class definition with a curly brace. This is a rare case in Java, a curly brace followed by a semicolon. Anonymous inner classes have no name, and their type must be either a subclass of the named type or an implementer of the named interface | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. That would not be a problem as both are specifying the contract that implement class has to follow. If class C implement interface A & interface B then Class C thing I need to implement print() because of interface A then again Class think I need to implement print() again because of interface B, it sees that there is already a method called test() implemented so it's satisfied. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Arrays provide a structure wherein multiple values can be accessed using single reference and index. This helps in iterating over the values using loops. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Class.getInstance doesn't call the constructor whereas if we create an object using new operator , we need to have a matching constructor or copiler should provide a default constructor. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Yes , using Class.getInstance. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Cloneable is a declaration that the class implementing it allows cloning or bitwise copy of it's object state. It is not having any method because it is a MARKER interface. | ||||
![]() | ||||
![]() ![]() ![]() ![]() | ||||
| ||||
Ans. When you expect your code will be accessed by different threads and these threads may change a particular data causing data corruption. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. No. Global variables are not allowed as it wont fit good with the concept of encapsulation. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Applet is a dynamic and interactive program that runs inside a web page displayed by a java capable browser. Lifecycle methods of 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 | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. Controls are components that allow a user to interact with your application and SWT / AWT supports the following types of controls: Labels, Push Buttons, Check Boxes, Choice Lists, Lists, Scrollbars, Text Components. These controls are subclasses of Component. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. It's a technique to allow multiple clients to make use of a cached set of shared and reusable connection objects providing access to a database or other resource. | ||||
![]() | ||||
![]() ![]() ![]() ![]() ![]() ![]() | ||||
| ||||
Ans. Both bitwise right shift operator ( >> ) and bitwise zero fill right shift operator ( >>> ) are used to shift the bits towards right. The difference is that >> will protect the sign bit whereas the >>> operator will not protect the sign bit. It always fills 0 in the sign bit. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
| ||||
Ans. System.out and System.err both represent the monitor by default and hence can be used to send data or results to the monitor. But System.out is used to display normal messages and results whereas System.err is used to display error messages and System.in represents InputStream object, which by default represents standard input device, i.e., keyboard. | ||||
![]() | ||||
![]() ![]() ![]() | ||||
![]() ![]() | ||||