Top 45 Java Webdynpro Interview Questions
Q1. What Is The Basic Difference Between The 2 Approaches To Exception Handling? 1> Try Catch Block And 2> Specifying The Candidate Exceptions In The Throws Clause? When Should You Use Which Approac
In the primary technique as a programmer of the method, you urself are dealing with the exception. This is first-class in case you are in a best role to decide have to be achieved in case of an exception. Whereas if it is not the duty of the method to cope with its very own exceptions, then do no longer use this approach. In this situation use the second technique. In the second one method, we are forcing the caller of the approach to seize the exceptions, that the approach is probably to throw. This is frequently the method library creators use. They listing the exception in the throws clause and we must catch them. You will locate the same approach all through the java libraries we use.
Q2. Are The Imports Checked For Validity At Compile Time? E.G. Will The Code Containing An Import Such As Java.Lang.Abcd Compile?
Yes, the imports are checked for the semantic validity at assemble time. The code containing above line of import will no longer bring together. It will throw an blunders pronouncing, cannot solve symbol
image: magnificence ABCD
location: package deal io
import java.Io.ABCD;
Q3. What Are Different Types Of Inner Classes?
Nested pinnacle-stage instructions, Member lessons, Local instructions, Anonymous training Nested top-stage lessons- If you claim a category inside a category and specify the static modifier, the compiler treats the elegance just like every other pinnacle-level class. Any elegance outdoor the putting forward class accesses the nested class with the maintaining elegance call appearing in addition to a package. Eg, outer. Inner. Top-level inner training implicitly have get right of entry to most effective to static variables. There can also be inner interfaces. These are of the nested pinnacle-stage range.
Member lessons – Member internal instructions are similar to different member methods and member variables and get admission to to the member magnificence is constrained, much like techniques and variables. This me a public member elegance acts further to a nested top-level magnificence. The number one distinction between member lessons and nested pinnacle-level training is that member lessons have get entry to to the unique instance of the enclosing magnificence.
Local training – Local instructions are like nearby variables, unique to a block of code. Their visibility is most effective in the block of their statement. For the elegance to be beneficial past the declaration block, it would want to implement a more publicly available interface. Because nearby classes aren't members, the modifiers public, protected, non-public, and static aren't usable.
Anonymous classes – Anonymous inner lessons enlarge neighborhood internal training one level in addition. As anonymous training don't have any name, you cannot provide a constructor.
Q4. What Are Checked And Unchecked Exception?
A checked exception is some subclass of Exception (or Exception itself), except for magnificence Runtime Exception and its subclasses. Making an exception checked forces consumer programmers to cope with the opportunity that the exception could be thrown. Eg, IOException thrown by java.Io.FileInputStream’s examine() method· Unchecked exceptions are Runtime Exception and any of its subclasses. Class Error and its subclasses are also unchecked. With an unchecked exception, but, the compiler doesn’t pressure customer programmers either to trap the exception or claim it in a throws clause. In reality, patron programmers may not even know that the exception may be thrown. Eg, StringIndexOutOfBoundsException thrown via String’s char At () technique· Checked exceptions must be stuck at compile time. Runtime exceptions do now not want to be. Errors often can't be.
Q5. What Are The Different Ways To Handle Exceptions?
There are ways to deal with exceptions:
By wrapping the desired code in a strive block observed through a catch block to catch the exceptions.
List the favored exceptions in the throws clause of the technique and permit the caller of the technique handle those exceptions.
Q6. Difference Between Swing And Awt?
AWT are heavy-weight additives. Swings are mild-weight additives. Hence swing works faster than AWT.
Q7. What One Should Take Care Of While Serializing The Object?
One have to ensure that each one the blanketed gadgets are also serializable. If any of the items isn't always serializable then it throws a Not Serializable Exception.
Q8. What Is Externalizable Interface?
Externalizable is an interface which includes strategies study External and write External. These methods come up with a manipulate over the serialization mechanism. Thus, if your magnificence implements this interface, you may customise the serialization system by way of implementing these techniques.
Q9. What Is View Assembly ?
A window defines the first-rate set of all feasible perspectives that a Web Dynpro utility ought to require even as going for walks a particular component. The number of views visible at any one time but, will normally be best a subset of the number of views embedded in the window.
The subset of perspectives rendered at anybody time is called the View Assembly. User interaction observed by subsequent navigation processing will frequently cause this subset of views to trade with every server spherical-ride. The view assembly represents those views visible with the aid of the person on their customer tool after the final touch of a particular server round ride.
Q10. How Does The Web Dynpro Framework Decide Which Particular Views Make Up The Current View Assembly ?
When an software is performed for the primary time, only those views which have their default flag set to real will belong to the primary view meeting.
Thereafter, user navigation will arise and the view assembly could be composed of those views which have been newly instantiated (as a result of their inbound plugs being fired), and people views that persist from the preceding view assembly (due to the fact no outbound navigation passed off from them).
Q11. What Is The Common Usage Of Serialization?
Whenever an item is to be sent over the community, items want to be serialized. Moreover, if the country of an item is to be saved, gadgets need to be serilazed.
Q12. What Is Final?
A very last magnificence can’t be extended ie., final magnificence might not be subclasses. A final approach can’t be overridden while its elegance is inherited. You can’t alternate fee of a final variable (is a regular)
Q13. Define Webdynpro Controller?
Controllers are the energetic elements of a Web Dynpro issue. In the layout of Web Dynpro controllers, SAP has made a tremendous change to the unique MVC concept of a controller.
Q14. Objects Are Passed By Value Or By Reference?
Java most effective supports skip via fee. With items, the object reference itself is surpassed by means of value and so each the unique reference and parameter reproduction both talk over with the equal item.
Q15. What Are The Types Of Controller? Describe ?
In large phrases, SAP has described classes of Web Dynpro controller. The difference between them is genuinely this: A controller either
Has a visible interface, or
Does now not have a visual interface.
SAP has delivered this difference in order to maintain a strict separation among those components of the business application that show information (usually records customers), and people parts of the business software that manner facts (generally information mills).
Q16. What Are Pass By Reference And Pass By Value?
Pass via Reference me the passing the deal with itself instead of passing the cost. Passby Value me passing a duplicate of the value to be exceeded.
Q17. What Is Hashmap And Map?
Map is Interface and Hashmap is class that implements that.
Q18. What Is Static In Java?
Static me one in step with magnificence, not one for every item regardless of what number of example of a class might exist. This me that you can use them without developing an instance of a category.Static techniques are implicitly very last, due to the fact overriding is done based totally on the type of the item, and static strategies are connected to a class, now not an object. A static method in a superclass can be shadowed by means of any other static approach in a subclass, if the authentic technique was no longer declared very last. However, you may’t override a static method with a non-static method. In different words, you can’t change a static method into an example technique in a subclass.
Q19. What Is The Difference Between A Constructor And A Method?
A constructor is a member feature of a class this is used to create objects of that elegance. It has the equal call as the elegance itself, has no go back type, and is invoked the use of the new operator. A technique is an regular member feature of a class. It has its very own name, a return kind (which can be void), and is invoked the usage of the dot operator.
Q20. What Is The Difference Between An Interface And An Abstract Class?
An summary class may have instance strategies that enforce a default behavior. An Interface can most effective claim constants and example strategies, however can not implement default conduct and all methods are implicitly abstract. An interface has all public participants and no implementation. An summary magnificence is a category which may additionally have the standard flavors of sophistication individuals (private, included, and so forth.), but has a few summary methods.
Q21. Before A Mapping Relationship Can Be Established, What Criteria Must Be Met ?
There must be a suitable node available to behave as a mapping beginning
Q22. What Happens To The Static Fields Of A Class During Serialization?
There are 3 exceptions wherein serialization does not necessarily read and write to the flow.
Serialization ignores static fields, because they're now not part of any state.
Base class fields are most effective dealt with if the bottom elegance itself is serializable.
Trient fields.
Q23. What Is An Abstract Class?
Abstract magnificence ought to be extended/subclassed (to be beneficial). It serves as a template. A class that is summary might not be instantiated (ie, you may now not name its constructor), summary magnificence might also comprise static information. Any magnificence with an summary approach is robotically summary itself, and should be declared as such. A magnificence can be declared abstract although it has no abstract methods. This prevents it from being instantiated.
Q24. What Is An Empty View ?
There is a unique type of view known as the empty view. This view calls for no guide implementation, neither is it viable to engage with it in any way aside from invoking its default inbound plug – display Empty View. If you require one specific region of a view set to be empty, then you need to embed the empty view into the view place. You can then treat this view just like every other view you have written, except that calling its inbound plug will motive the corresponding view place to be blanked out. If a view set has had no views manually embedded into one among its view areas, then the empty view will be substituted automatically.
Q25. What Is Serialization?
Serialization is a mechanism with the aid of which you could store the nation of an item via converting it to a byte flow.
Q26. Describe Synchronization In Respect To Multithreading?
With appreciate to multithreading, synchronization is the functionality to control the get admission to of more than one threads to shared sources. Without synchronization, it's far viable for one thread to regulate a shared variable at the same time as some other thread is inside the manner of the usage of or updating same shared variable. This generally ends in vast errors.
Q27. Difference Between Hashmap And Hashtable?
The HashMap elegance is kind of equivalent to Hashtable, except that it's far unsynchronized and permits nulls. (HashMap lets in null values as key and price whereas Hashtable doesnt permit). HashMap does not assure that the order of the map will continue to be constant over time. HashMap is unsynchronized and Hashtable is synchronized.
Q28. What Is The First Argument Of The String Array In Main Method?
The String array is empty. It does not have any detail. This is unlike C/C++ where the first detail via default is the program call
Q29. What Is An Iterator?
Some of the collection training provide traversal of their contents thru a java.Util.Iterator interface. This interface permits you to stroll thru a group of objects, running on each object in turn. Remember when the usage of Iterators that they comprise a image of the collection at the time the Iterator changed into acquired; typically, it is not advisable to alter the collection itself at the same time as traversing an Iterator.
Q30. What Are Recursion Nodes ?
The recursion node is a unique sort of node used whilst a node hierarchy with a recursive structure wishes to be created. This is wanted whilst, for instance, the intensity of the node hierarchy is not recognised until runtime. Using a recursion node, you can declare that a selected node structure be replicated as a infant of itself. A desirable instance right here is in case your context needs to preserve information inside the equal structure as a document gadget, containing directories and sub directories.
Q31. If The View Set Concept Is Not Implemented In Web Dynpro For Abap, What Options Are There For Reusing Views ?
In both Web Dynpro for ABAP and Java, there may be a selected UI Element called the View Container. This UI element, whilst delivered to a view layout, acts as a container for some other view. View Containers can be organized in huge variety of approaches which will achieve the desired format at the display screen.
The perspectives that may be embedded right into a View Container UI element are the following:
Any view from the contemporary element
Any visual interface from a toddler Web Dynpro factor
An empty view (furnished routinely through the Web Dynpro runtime)
Q32. What Is A View Set ?
A view set is a visual framework that subdivides the window into predefined regions. Each subdivision of a view set is called a view region, and a couple of perspectives may be embedded into a unmarried View Area.
The following preconfigured view units are to be had:
T layout T layout 90o T layout 180o T format 270o Grid layout Tab strip
Each subdivision in the view set format is known as a view vicinity.
Q33. Difference Between Vector And Arraylist?
Vector is synchronized while arraylist isn't.
Q34. What If I Write Static Public Void Instead Of Public Static Void?
Program compiles and runs well.
Q35. What Is The Difference Between Declaring A Variable And Defining A Variable?
In announcement, we just point out the type of the variable and it’s name. We do no longer initialize it. But defining me announcement + initialization. E.G String s; is only a statement whilst String s = new String (“abcd”); Or String s = “abcd”; are both definitions.
Q36. How Can One Prove That The Array Is Not Null But Empty Using One Line Of Code?
Print args.Duration. It will print @That me it's far empty. But if it'd had been null then it'd have thrown a Null Pointer Exception on trying to print args.Duration.
Q37. How Can You Determine Lifespan Of Custom Controllers ?
The lifespan of a custom controller is decided via a parameter putting made at some stage in the design time announcement. It may be both “Framework Controlled” or “On call for”. If you choose “Framework Controlled”, then the Web Dynpro framework will instantiate the custom controller whilst the thing is instantiated. If however, you pick out “On call for”, then the Web Dynpro developer have to write the coding essential to instantiate the custom controller.
Each baby element utilization is instantiated with a unique name that have to be described at design time. During the lifespan of the discern element, a toddler component may additionally best ever be instantiated once below a given name; however, have to or not it's vital, you could declare a couple of usages of the same child aspect as long as you specify distinctive usage names.
Q38. What Is Face Less Component ?
It is part with zero perspectives and zero windows. Such a component is known as a “faceless” issue and is beneficial while a complicated unit of functionality requiring no direct person interaction wishes to be encapsulated. A right example of a faceless issue is the introduction of something referred to as a model issue. This is not surely a selected Web Dynpro thing kind; as a substitute it's miles a trendy Web Dynpro element that has been written mainly for the project of interacting with a version object.
Q39. How Is Model-driven Architecture Implemented In Web Dynpro Framework ?
Web dynpro framework makes use of declarative programming techniques to create a meta-version of the utility that's free from back-give up and the front-stop programming languages. Rather the metadata is programming language-impartial and has statistics saved in XML layout. It’s only at some point of run-time that the rendering engine generates the code in html and java script from this meta model of the software. So the layout component – which defines the UI and information go with the flow between UI factors – is completely abstracted minimizing the coding (that's required most effective for imposing commercial enterprise common sense).
The model-pushed technique facilitates developer to focus less on coding and era component and greater on the layout part of the utility – “minimizing coding and maximizing layout”. Naturally, the primary focus of enterprise software developer ought to be the enterprise common sense and the technological implementation should not distract him.
Q40. What If I Do Not Provide The String Array As The Argument To The Method?
Program compiles but throws a runtime blunders “NoSuchMethodError”.
Q41. What If The Main Method Is Declared As Private?
The application compiles well but at runtime it'll provide “Main approach no longer public.” message.
Q42. Which Methods Of Serializable Interface Should I Implement?
The serializable interface is an empty interface; it does not comprise any strategies. So, we do not put into effect any strategies.
Q43. Explain The Concept Of Lazy Data Access?
The Web Dynpro framework has been constructed to comply with the precept of Lazy Data Access. This me that the processing required to generate facts will not be invoked until the statistics is actually wanted. When this principle is carried out to the architecture of the context, it me that unless there is an try to get entry to the data in a singleton toddler node, then even though the lead choice in the parent node has changed, the kid node’s deliver function will now not be called.
Q44. How Do I Serialize An Object To A File?
The magnificence whose instances are to be serialized must put in force an interface Serializable. Then you bypass the instance to the Object Output Stream that is connected to a document output movement. This will shop the object to a document.
Q45. What Is The Purpose Of Garbage Collection In Java, And When Is It Used?
The purpose of garbage collection is to identify and discard gadgets which might be no longer wished via a program in order that their resources can be reclaimed and reused. A Java item is concern to garbage collection when it turns into unreachable to this system wherein it is used.
