Showing posts with label J2EE. Show all posts
Showing posts with label J2EE. Show all posts

November 19, 2021

Top 20 Oracle ADF Interview Questions and Answers

 

Ques: 1). What is Oracle ADF, and how does it work?

Answer: 

The Oracle Application Development Framework (Oracle ADF) is an end-to-end application framework that simplifies and accelerates the implementation of service-oriented applications by leveraging J2EE standards and open-source technologies. Oracle ADF can help you construct enterprise applications that use web, wireless, desktop, or web services interfaces to search, display, generate, change, and validate data. With drag-and-drop data binding, visual UI design, and team development tools built-in, Oracle JDeveloper 10g and Oracle ADF provide an environment that covers the whole development lifecycle from design to deployment.


Oracle Fusion Applications interview Questions and Answers


Ques: 2). What is Managed Bean, and how does it work?

Answer: 

Managed beans are JavaBean objects that are managed by a JSF implementation. A managed bean represents the process of creating and managing a bean. It has nothing to do with the functionality of the bean.

A managed bean is one that is produced and initialised in a controlled manner. JSF, as you may know, employs a lazy initialization model. It means that the bean in a specific scope is created and initialised on-demand, that is, when the bean is requested for the first time.


Oracle Accounts Payables Interview Questions and Answers


Ques: 3). What exactly is task flow?

Answer: 

ADF task flows are a modular way to defining application control flow. You can break up an application into reusable task flows rather than portraying it as a single huge JSF page flow. A piece of the application's navigational graph is contained in each task flow. The activities are the nodes in the task flows. A simple logical process, such as displaying a page, running application logic, or calling another task flow, is represented by an activity node. Control flow cases are the interactions between the activities.


Oracle Access Manager Interview Questions and Answers


Ques: 4). What are the benefits of task flow over JSF flow?

Answer: 

  • ADF task flows have a number of advantages over JSF page flows.
  • The app can be divided into a set of modular processes that communicate with one another.
  • Views, method calls, and calls to other task flows can all be added to the task flow diagram.
  • Navigation is used to move between sites and other operations, such as routers.
  • Task flows created using ADF can be reused inside the same or a different application. You might decide to reuse task flows after you've broken up your application into task flows.
  • Data can be transmitted between activities inside the task flow using shared memory scope (for example, page flow scope).
  • Page flow scope defines a unique storage area for each instance of an ADF bounded task flow.


Oracle Fusion HCM Interview Questions and Answers


Ques: 5). What is Adf Event handling and how does it work?

Answer: 

Event handling is normally done on the server in classic JSF applications. JSF event handling is based on the JavaBeans event paradigm, in which the JSF application uses event classes and event listener interfaces to handle events provided by components.

Clicking a button or link, selecting an item from a menu or list, and altering a value in an input field are all examples of user events in an application. When a user activity, such as pressing a button, occurs, the component creates an event object, which holds information about the event and identifies the component that caused it. An event queue is also created for the event. JSF instructs the component to broadcast the event to the relevant registered listener at the appropriate point in the JSF lifecycle, which then calls the listener method to process the event. The listener method can either update the user interface or call backend application logic.

ADF Faces command components, like regular JSF components, send out ActionEvent events when they're triggered, while ADF Faces input and select components send out ValueChangeEvent events when their local values change.


Oracle SCM Interview Questions and Answers


Ques: 6). What is Association Accessor?

Answer: 

It's a method for an entity instance at one end of an association to communicate with the linked entity object instance at the other end. A source assessor travels from the destination to the source, while a destination assessor travels from the source to the destination.

It is described in the entity object definition xml files, which can be used to specify cross entity relationships by view object and view link definition. Its return type is either the associated entity object definition's entity object class or 'EntityImpl' if the associated entity object definition does not have an entity object class.


Oracle Financials Interview questions and Answers


Ques: 7). What is the difference between Datacontrol.dcx and Databindings.cpx?

Answer: 

The Oracle ADF binding context for your entire application is contained in the DataBindings.cpx file, which also contains the metadata from which the Oracle ADF binding objects are constructed at runtime. When you register data controls on business services, the DataControls.dcx file is created. Oracle ADF Business Components does not generate this file. It specifies the Oracle ADF model layer data control classes (factory classes) that help the client and the accessible business service interact.


Oracle Cloud Interview Questions and Answers


Ques: 8). Why did you choose ADF?

Answer: 

I had already developed a strong interest in technology with the goal of making a substantial impact. As the main development framework, ADF may be used to create virtually any form of enterprise application. I became interested in this technology since it is so beneficial. Of course, this is in keeping with my goals and ambitions.

Second, ADF is widely recognised as the most advanced J2EE development framework. As a result, the ADF 11g is used to build the Oracle Fusion Middleware stack. This is why we have so many options here.

Finally, ADF contains a number of built-in components that help us with the work of developing code. This way, I can actually focus on the features of the application and how it can do more good to the business.


Oracle PL/SQL Interview Questions and Answers


Ques: 9). What is the difference between a binding context and a binding container?

Answer: 

The binding context, which is used to access the binding layer, is a runtime map between data controls and page definitions of pages in the application. The EL expression on your jspx pages gives you access to it. The page bindings are instantiated using the binding container, which is a request-scoped map. The EL expressions provide access to this. It is also accessible throughout every page request because it is a request-scoped map.


Oracle SQL Interview Questions and Answers


Ques: 10). What is the difference between Visible and Render property?

Answer: 

The visible property is set to true or false depending on whether the field should be visible on the page at run time. Even though the field or component is hidden, it still exists on the page.

The render attribute is used to load the component conditionally based on a set of criteria.


Oracle RDMS Interview Questions and Answers


Ques: 11).  In Adf, how do you define pagination?

Answer: 

In ADF, we establish custom pagination by utilising the af:iterator tag to create a custom table as a taskflow. This renders the data collection in the same way that a table does. Now, using the ADF bindings declaration, we tie the value property of the iterator to the collection model and set the number of visible rows to 15, for example.


BI Publisher Interview Questions and Answers

 

Ques: 12).  What is the Adf Lifecycle and how does it work?

Answer: 

The ADF Lifecycle is divided into nine stages:

1.      Set the Context: The lifecycle, the binding container, and other values are all set.

2.      Create the Model: The application model is created by providing it with the necessary parameters. ADF is also provided the necessary instructions.

3.      Apply Input Values: This phase handles the application's access request.

4.      Validate Input Values: Verifies the values specified in phase 3 of the request.

5.      Update Model: Data is stacked up and updated when the input values have been validated.

6.      Validate Model Updates: Validate the updated input values.

7.      Process Component Updates: This is where all activities involving input values are handled.

8.      Metadata Commit: Commits the metadata runtime to the model.

9.      Prepare Render: All the activities and the final page is sent to render.

 

Oracle 10g Interview Questions and Answers


Ques: 13).  What is the difference between Valuators and Converters?

Answer: 

To give conversion and validation capabilities to the ADF input components, Valuators and Convertors are used.

After the values on ADF forms are changed and submitted, converters convert the values to the type that the application accepts.

Valuators are used to enforce input component validations.

 

Ques: 14). What is Partial Page Rendering, and how does it work?

Answer: 

PPR (Partial Page Rendering) is quite similar to Ajax. PPR is a dynamic system that takes appropriate action as needed. It triggers the page when it needs to be triggered. It updates the page when it needs to. Once all of the activities are in order, PPR submits the page.

You'll need to do the following to allow partial page rendering:

Auto-submit: When auto-submit is on or set to true, the page automatically submits the values updated or changed on the page.

PartialSubmit: When the partialSubmit is set to true, the changes and updates on the page submit the page partially.

Partial trigger: When the partial trigger is on, the page renders are simply listed. Once the triggers are settled, final changes are considered.

 

Ques: 15).   Is ADF a better framework than JSF?

Answer: 

The ADF framework is based on the JSF. When it comes to processing any business application, ADF is quite smooth.

Let's look at it from the user's perspective:

The ADF possesses the following:

  • The UI is simple and straightforward to use.
  • Even if they are viewing it for the first time, anyone can readily access it.
  • Almost everything is in one location.
  • The appearance and feel are smooth and solid.
  • From the developer's perspective:
  • It's a simple platform on which to build an application.
  • More than a hundred components that are ready to use
  • Components that can be edited to alter the functionality
  • Simple to keep up with
  • Simple to set up
  • Simple to use
  • Drag and drop functionality is available.

As ADF is built on JSF, any time ADF will give you a nicer and smoother performance. JSF is, nonetheless, a very good platform too. But when it comes to comparison, ADF is better.

 

Ques: 16). What is the Role Of View Object, Entity Object, and Application Module?

Answer: 

View object: View objects show the modifications made by the user to Taskflows projects. VO aids the system in sorting through the user's actions. And it organises, filters, and maintains the task so that SQL queries may quickly discover the results when they're looking for them.

Entity object: In a database, an entity object is a row. EO is the ADF, similar to EJB in J2EE. The values in the row are also easy to recognise with EO. It encapsulated the entire row in a specific value. As a result, searching for any value in the row becomes much easier. Even two EOs might be related to one another and grouped together based on their relationship. Entity Associations are a group of connected EOs.

An application module allows a customer to access their work via the platform. AM contains all of the essential and top-level processes, as well as the most up-to-date information. AM is sometimes referred to as the transactional module because it lets clients to access their own work. In the View link form, there are also numerous VO and Entity Associates.

 

Ques: 17). What does it mean to be a Phase Listener?

Answer: 

The Oracle ADF lifecycle is fully integrated with the JavaServer Faces request lifecycle, including everything needed to set up the binding context, prepare the binding container, validate and update the ADF model, persist MDS changes, and prepare the response.

An ADF Phase Listener can be used by developers that need to listen to and engage with the request cycle. The ADF Phase Listener, unlike the Phase Listener defined in the faces-config.xml file, allows you to listen to both the standard and ADF phases. Of course, the ADF Phase Listener is written in Java and configured in the adf-settings.xml file you must generate.

The ADF PagePhaseListener can be used in any situation.

Developers can utilise either a conventional JSF listener or a particular ADF listener in the Oracle ADF framework, which provides extra ADF-specific page cycle enhancements. The ADF Lifcycle can be customised with listeners.

 

Ques: 18). What is inter-portlet communication, and how does it work?

Answer: 

When an action in one portlet causes a reaction in another, this is known as inter-portlet communication. It serves as a link between two portlets. One portlet, for example, has a checkbox with a list of products. When I select a product from the list and press the submit button, the other portlet displays the product's data.

 

Ques: 19). What is the meaning of Association Accessor?

Answer: 

It's a method for an entity instance at one end of an association to communicate with the linked entity object instance at the other end. A source assessor travels from the destination to the source, while a destination assessor travels from the source to the destination.

It is described in the entity object definition xml files, which can be used to specify cross entity relationships by view object and view link definition. Its return type is either the associated entity object definition's entity object class or 'EntityImpl' if the associated entity object definition does not have an entity object class.

 

Ques: 20). What are the various Bean Scopesin JSF types?

Answer: 

Three Bean Scopes are supported by JSF.

Request Scope: The request scope is only valid for a certain time. It begins with the submission of an HTTP request and finishes with the delivery of the response to the client.

Session Scope: From the time a session is formed until it is terminated, the session scope persists.

Application Scope: The application scope remains constant throughout the web application's lifecycle. The scope of all requests and sessions is the same.

 

 


June 05, 2019

Top 50 Advance Java Interview Questions and Answers


Ques: 1. What do you understand by Private, Protected and Public?
 

Answer: 

Private, Protected and Public are the accessibility modifiers. Private is the most restrictive, while public is the least restrictive. There is no real difference between protected and the default type (also known as package protected) within the context of the same package, however the protected keyword allows visibility to a derived class in a different package. 

AngularJS Interview Questions and Answers


Ques: 2. What is a java package? How is it used?

Answer: 

A Java package is a naming context for classes and interfaces.

  • A package is used to create a separate name space for groups of classes and interfaces.
  • Packages are used to organize related classes and interfaces into a single API unit and to control accessibility to these classes and interfaces.

AJAX interview Questions and Answers


Ques: 3. What do you understand by EAR, JAR and WAR File?


Answer:
Enterprise Archives (EAR): An EAR file contains all the components that make up a J2EE application.

Java Archives (JAR): A JAR file encapsulates one or more Java classes, a manifest, and a descriptor. JAR files are the lowest level of archive. JAR files are used in J2EE for packaging EJBs and client-side Java Applications.

Web Archives (WAR): WAR files are like JAR files, except that they are specifically for web applications made from Servlets, JSPs, and supporting classes.

JavaScript Interview Questions and Answers


Ques: 4. How Java Source Code files are named?

Answer: 

A source code file may contain at most one public class or interface. A Java source code file takes the name of a public class or interface that is defined within the file. Source code files use the .java extension.
If a public class or interface is defined within a source code file, then the source code file must take the name of the public class or interface. If no public class or interface is defined within a source code file, then the file must take on a name that is different than its classes and interfaces.


Node.js Interview Questions and Answers


Ques: 5. What do you understand by Numeric Promotion?

Answer: 

In numerical promotion, byte, char, and short values are converted to int values. It is the conversion of a smaller numeric type to a larger numeric type, so that integer and floating-point operations may take place. if required, the int values are also converted to long values. The long and float values can be converted to double values.

JQuery Interview Questions and Answers



Ques: 6. What is the difference between Time Slicing and Preemptive Scheduling?

Answer: 

Under time slicing in java, a task executes for a predefined slice of time and then reenters the pool of ready tasks.
But under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states, or a higher priority task comes into existence.

The scheduler then determines which task should execute next, based on priority and other factors.

 

Ques: 7. What do you mean by a Task's Priority? How is it used in Scheduling?

Answer: 

A task's priority is an integer value that identifies the relative order in which it should be executed with respect to other tasks. The scheduler attempts to schedule higher priority tasks before lower priority tasks.


Ques: 8. What technologies are included in J2EE?

Answer: 

The various technologies in J2EE are:

  • Enterprise JavaBeansTM (EJBsTM).
  • JavaServer PagesTM (JSPsTM).
  • Java Servlets.
  • The Java Naming and Directory InterfaceTM (JNDITM).
  • The Java Transaction API (JTA).
  • CORBA.
  • The JDBCTM data access API.

 

Ques: 9. What is the main purpose of the Wait(), Notify() and Notifyall() methods in java?

Answer: 

These methods are used to provide an efficient way for threads to wait for a shared resource. When a thread in java executes an object's wait() method, it enters the waiting state. It only enters the ready state after another thread invokes the object's notify() or notifyAll() methods.

 

Ques: 10. What happens when you invoke a Thread's interrupt method while it is Sleeping or Waiting?

Answer: 

When a task's interrupt() method is executed, the task enters the ready state. The next time the task enters the running state, an InterruptedException is thrown.

 

Ques: 11. What are the various restrictions placed on method overriding?

Answer:

  • The overriding method may not limit the access of the method it overrides.
  • Overridden methods must have the same name, argument list, and return type.
  • The overriding method may not throw any exceptions that may not be thrown by the overridden method.


Ques: 12. What do you understand by Java Swing?

Answer: 

Swing is basically a type of Toolkit which is GUI toolkit for Java. It is one part of the Java Foundation Classes (JFC). Swing includes graphical user interface (GUI) widgets such as text boxes, buttons, split-panes, and tables.
Swing supports pluggable look and feel, not by using the native platform's facilities, but by roughly emulating them. This means you can get any supported look and feel on any platform.
Swing widgets provide more sophisticated GUI components than the earlier Abstract Window Toolkit. Since they are written in pure Java, they run the same on all platforms. The advantage is uniform behavior on all platforms. The disadvantage of lightweight components is slower execution.


Ques: 13. What are the differences between Swing and AWT?

Answer: 

There are many differences between Swing and AWT:

  • AWT is heavy-weight components, but Swing is light-weight components.
  • AWT is OS dependent because it uses native components, But Swing components are OS independent.
  • Can change the look and feel in Swing which is not possible in AWT.
  • Swing takes less memory compared to AWT.
  • For drawing AWT uses screen rendering where Swing uses double buffering.

 

Ques: 14. What are the Types of Scaling?

Answer: 

In java, there are two types of scaling: Horizontal Scaling and Vertical Scaling.

Horizontal Scaling: When Clones of an application server are defined on multiple physical m/c, it is called Horizontal Scaling. The objective is to use more than one less powerful m/c more efficiently.

Vertical Scaling: When multiple server clones of an application server are defined on the same physical m/c, it is called Vertical Scaling. The objective is to use the processing power of that m/c more efficiently.

 

Ques: 15. What are the types of Class Loaders in java?

Answer: 

In java, there are three types of class loader as bootstarp class loader, extension class loader and system class loader.

Bootstrap Class Loader: Bootstrap class loader loads java’s core classes like java.lang, java.util etc. These are classes that are part of java runtime environment. Bootstrap class loader is native implementation and so they may differ across different JVMs.

 Extensions Class Loader: JAVA_HOME/jre/lib/ext contains jar packages that are extensions of standard core java classes. Extensions class loader loads classes from this ext folder. Using the system environment property java.ext.dirs you can add ‘ext’ folders and jar files to be loaded using extensions class loader.

System Class Loader: Java classes that are available in the java classpath are loaded using System class loader.



Ques: 16. What are differences between the boolean & operator and the && operator?

Answer: 

If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated.
If the first operand returns a value of true, then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

 

Ques: 17. What do you mean by Casting?

Answer: 

In java, there are two types of casting:

1). casting between primitive numeric types: Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values.

2). casting between object references: Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.


Ques: 18. How does a Try statement determine which Catch clause should be used to handle an exception?

Answer: 

When an exception is thrown within the body of a try statement, the catch clauses of the try statement are examined in the order in which they appear. The first catch clause that is capable of handling the exception is executed. The remaining catch clauses are ignored.

 

Ques: 19. What will happens if Remove( ) is never invoked on a session bean?

Answer: 

In case of stateful session bean, the bean may be kept in cache till either the session times out, in which case the bean is removed or when there is a requirement for memory in which case the data is cached and the bean is sent to free pool.
In case of a stateless session bean it may not matter if we call or not as in both cases nothing is done. The number of beans in cache is managed by the container.


Ques: 20. What Is Java Reflection Api?

Answer: 

Reflection is one of the most powerful api which help to work with classes, methods and variables dynamically. Basically, it inspects the class attributes at runtime. Also, we can say it provides a metadata about the class.

 

Ques: 21. What is the Collection API in java?

Answer: 

The Collection API is a set of classes and interfaces that support operation on collections of objects. These classes and interfaces are more flexible, more powerful, and more regular than the vectors, arrays, and hashtables if effectively replaces.

Example of classes: HashSet, HashMap, ArrayList, LinkedList, TreeSet and TreeMap.

Example of interfaces: Collection, Set, List and Map.



Ques: 22. What is the difference between Session and Entity Beans?

Answer: 

An entity bean represents persistent global data from the database; a session bean represents transient user-specific data that will die when the user disconnects (ends his session). Generally, the session beans implement business methods that call entity beans .


Ques: 23. What do you understand by Abstract Schema in java?

Answer: 

In java, you can specify the name of the Abstract schema name in the deployment descriptor. The queries written in EJB QL for the finder methods references this name. It is a part of an entity bean’s deployment descriptor which defines the bean’s persistent fields and their relationship. Abstract schema is specified for entity beans with container managed persistence. The information provided in this Abstract Schema is used by the container for persistence management and relationship management.


Ques: 24. What is the use of the Finally block? Is Finally block in Java guaranteed to be called? When will it is not called?

Answer:

The code in finally block will execute even if an exception is occurred. Finally, is the block of code that executes always. Finally block is NOT called in following conditions:

  • If the JVM exits while the try or catch code is being executed, then the finally block may not execute. This may happen due to System.exit() call.
  • if the thread executing the try or catch code is interrupted or killed, the finally block may not execute even though the application as a whole continues.
  • If an exception is thrown in finally block and not handled, then remaining code in finally block may not be executed.


Ques: 25. What do you mean by Local Interface. How values will be passed to them?

Answer: 

An EJB can use local client view only if it is really guaranteed that other enterprise beans or clients will only address the bean within a single JVM. With local client view, you can do pass-by-reference, which means your bean, as well as the client, will work directly with one copy of the data. Any changes made by the bean will be seen by the client and vice versa. Pass-by-reference eliminates time/system expenses for copying data variables, which provides a performance advantage.


Ques: 26. What is the main difference between Serializable and Externalizable Interfaces?

Answer: 

Both interfaces are used for implementing serialization. But, the basic difference is Serializable interface does not have any method (it’s a marker interface) and Externalizable interface having 2 methods such as readExternal() and writeExternal(). Serializable interface is the super interface for Externalizable interface.



Ques: 27. What is the relation between Local Interfaces and Container-managed relationships?

Answer: 

To be the target of a container-managed relationship, an entity bean with container-managed persistence must provide a local interface. Entity beans that have container-managed relationships with other entity beans, must be accessed in the same local scope as those related beans, and therefore typically provide a local client view.

 

Ques: 28. What are the differences between Creating String as New() and Literal?

Answer: 

When we create string with new() Operator, it’s created in heap and not added into string pool while String created using literal are created in String pool itself which exists in PermGen area of heap.
String s = new String(“Test”);
It does not put the object in String pool, we need to call String.intern() method which is used to put  them into String pool explicitly. its only when you create String object as String literal e.g. String s = “Test” Java automatically put that into String pool.


Ques: 29. What is the main difference between Final, Finally And Finalize?

Answer: 
Final is used to apply restrictions on class, method and variable. Final class can’t be inherited, final method can’t be overridden, and final variable value can’t be changed.

Finally is used to place important code, it will be executed whether exception is handled or not.
Finalize is used to perform clean up processing just before object is garbage collected.

 

Ques: 30. How can an Object's Finalize() Method be invoked while it is reachable?

Answer: 

An object's finalize() method cannot be invoked by the garbage collector while the object is still reachable. However, an object's finalize() method may be invoked by other objects.

 

Ques: 31. What do you mean by an Object’s Lock? Which Object Have Locks?

Answer: 

A thread may execute a synchronized method of an object only after it has acquired the object’s lock. An object’s lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. All objects and classes have locks. A class’s lock is acquired on the class’s Class object.


Ques: 32. What are the uses of Observer and Observable?

Answer: 

Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by objects that observe Observable objects.

 

Ques: 33. How ConcurrentHashMap Works?

Answer:

Basically, ConcurrentHashMap locks each of the box (by default 16) which can be locked independently and thread safe for operation. The basic design of ConcurrentHashMap is to handling threading. And it does not expose the internal lock process.

 

Ques: 34. What are Transient Variables in java?

Answer: 

In Java, Transient variables can’t be serialized. For example, if a variable is declared as transient in a Serializable class and the class is written to an ObjectStream, the value of the variable can’t be written to the stream instead when the class is retrieved from the ObjectStream the value of the variable becomes null.


Ques: 35. What do you understand by JFC?

Answer: 

JFC stands for Java Foundation Classes. The Java Foundation Classes (JFC) are a set of Java class libraries provided as part of Java 2 Platform, Standard Edition (J2SE) to support building graphics user interface (GUI) and graphics functionality for client applications that will run on popular platforms such as Microsoft Windows, Linux, and Mac OSX.


Ques: 36. What is the main difference between Find and Select methods In EJB?

Answer: 

A select method can return a persistent field (or a collection thereof) of a related entity bean. A finder method can return only a local or remote interface (or a collection of interfaces).

A select method is defined in the entity bean class. For bean-managed persistence, a finder method is defined in the entity bean class, but for container-managed persistence it is not.
Because it is not exposed in any of the local or remote interfaces, a select method cannot be invoked by a client. It can be invoked only by the methods implemented within the entity bean class. A select method is usually invoked by either a business or a home method.


Ques: 37. If some new data has entered in the database, how can a servlet refresh automatically?

Answer: 

It depends on the scenario, how you can handle them. You need to handle this in dao layer, when doing insert operation, you can call a utility method which will load the context ServletContextListener. Because, servlets are basically used for handling request and give the response.


Ques: 38. What do you mean by In-memory replication?

Answer: 

The process by which the contents in the memory of one physical m/c are replicated in all the m/c in the cluster is called in-memory replication.


Ques: 39. What do you understand by synchronization? Why is it so Important?

Answer: 

In respect of multithreading, synchronization is the capability to control the access of multiple threads to shared resources. In the absence of synchronization, it is possible for one thread to modify a shared object while another thread is in the process of using or updating that object's value. This often leads to significant errors.

 

Ques: 40. How many Bits are used to represent Unicode, ASCII, UTF-16 and UTF-8 characters?

Answer: 

Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. Unicode requires 16 bits and ASCII require 7 bits. UTF-8 represents characters using 8, 16, and 18 bits patterns. UTF-16 uses 16-bit and larger bit patterns.



Ques: 41. What is a Clone in java?

Answer: 

In java, the copies of a server group are called Clones. But unlike a Server Group Clones are associated with a node and are real server process running in that node.


Ques: 42. How does the Garbage Collection guarantee that a program will not run out of memory?

Answer: 

In java, garbage collection does not guarantee that a program will not run out of memory. It is possible for programs to use up memory resources faster than they are garbage collected. It is also possible for programs to create objects that are not subject to garbage collection.


Ques: 43. What do you mean by AWT?

Answer: 

AWT is stands for Abstract Window Toolkit. AWT enables programmers to develop Java applications with GUI components, such as windows, and buttons. The Java Virtual Machine (JVM) is responsible for translating the AWT calls into the appropriate calls to the host operating system.


Ques: 44. What Advantage do Java's Layout Managers provide over traditional Windowing Systems?

Answer: 

Java uses layout managers to lay out components in a consistent manner across all windowing platforms. Since Java's layout managers aren't tied to absolute sizing and positioning, they are able to accommodate platform-specific differences among windowing systems.


Ques: 45. Is Decorator an EJB design pattern?

Answer: 

Decorator design pattern is not an EJB design pattern. It is the one which exhibits very low-level runtime polymorphism, for the specific and single object (Instance of the class). But not for at least for a class. It is the stuff to add specific functionality to a single & pointed object and leaves others like it unmodified. It is having close similarities like AspectJ stuff, but not with EJB stuff.


Ques: 46. What is the main purpose of the Enableevents() method?

Answer: 

The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event.
The enableEvents() method is used by objects that handle events by overriding their event-dispatch methods.


Ques: 47. What is the main difference between Paint() and PaintComponent()?

Answer: 

The main point is that the paint() method invokes three methods in the following order:

  • PaintComponent()
  • PaintBorder()
  • paintChildren()

As a general rule, in Swing, we should be overriding the paintComponent method unless we know what we are doing paintComponent() paints only component (panel) but paint() paints component and all its children.


Ques: 48. What do you understand by double buffering ?

Answer: 

Double buffering is the process of using two buffers rather than one to temporarily hold data being moved to and from an I/O device. Double buffering increases data transfer speed because one buffer can be filled while the other is being emptied.


Ques: 49. What is the main difference between the File and RandomAccessFile Classes?

Answer: 

The File class encapsulates the files and directories of the local file system.
The RandomAccessFile class provides the methods needed to directly access data contained in any part of a file.

 

Ques: 50. Can you Name some of the Layoutmanagers In Java?

Answer: 

Some of the LayoutManagers in java are:

  • Flow Layout Manager
  • Grid Layout Manager
  • Box Layout Manager
  • Border Layout Manager
  • Card Layout Manager
  • GridBag Layout Manager