Java WebDynpro Interview Questions & Answers

4 avg. rating (80% score) - 1 votes

Java WebDynpro Interview Questions & Answers

Are you preparing for Java WebDynpro job interview? Web Dynpro JAVA (WDJ) is the SAP standard UI framework for developing Web applications in the SAP NetWeaver JAVA environment. Web Dynpro Java applications are developed within NetWeaver Developer Studio using a model-driven approach that minimizes manual UI coding and uses visual tools to design components. Looking for a job can be cumbersome and tiring, especially when you are not aware of how to apply and where to search and how to prepare well for the job interviews. Wisdomjobs framed Java WebDynpro job interview questions and answers to make it easier for your interview preparation. If you are expertise in Java programming language along with WebDynpro, then multiple job opportunities are available for your reference.

Java WebDynpro Interview Questions

Java WebDynpro Interview Questions
    1. Question 1. What Is The Purpose Of Garbage Collection In Java, And When Is It Used?

      Answer :

      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.

    2. Question 2. What If The Main Method Is Declared As Private?

      Answer :

      The program compiles properly but at runtime it will give “Main method not public.” message.

    3. Question 3. What If I Write Static Public Void Instead Of Public Static Void?

      Answer :

      Program compiles and runs properly.

    4. Question 4. What If I Do Not Provide The String Array As The Argument To The Method?

      Answer :

      Program compiles but throws a runtime error “NoSuchMethodError”.

    5. Question 5. What Is The First Argument Of The String Array In Main Method?

      Answer :

      The String array is empty. It does not have any element. This is unlike C/C++ where the first element by default is the program name

    6. Question 6. How Can One Prove That The Array Is Not Null But Empty Using One Line Of Code?

      Answer :

      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 Null Pointer Exception on attempting to print args.length.

    7. Question 7. What Are Checked And Unchecked Exception?

      Answer :

      A checked exception is some subclass of Exception (or Exception itself), excluding class Runtime Exception and its subclasses. Making an exception checked forces client programmers to deal with the possibility that the exception will be thrown. eg, IOException thrown by’s read() method· Unchecked exceptions are Runtime Exception and any of its subclasses. Class Error and its subclasses also are unchecked. With an unchecked exception, however, the compiler doesn’t force client programmers either to catch the exception or declare it in a throws clause. In fact, client programmers may not even know that the exception could be thrown. eg, StringIndexOutOfBoundsException thrown by String’s char At () method· Checked exceptions must be caught at compile time. Runtime exceptions do not need to be. Errors often cannot be.

    8. Question 8. What Are Different Types Of Inner Classes?

      Answer :

      Nested top-level classes, Member classes, Local classes, Anonymous classes Nested top-level classes- If you declare a class within a class and specify the static modifier, the compiler treats the class just like any other top-level class. Any class outside the declaring class accesses the nested class with the declaring class name acting similarly to a package. eg, outer. Inner. Top-level inner classes implicitly have access only to static variables. There can also be inner interfaces. These are of the nested top-level variety.

      Member classes – Member inner classes are just like other member methods and member variables and access to the member class is restricted, just like methods and variables. This means a public member class acts similarly to a nested top-level class. The primary difference between member classes and nested top-level classes is that member classes have access to the specific instance of the enclosing class.

      Local classes – Local classes are like local variables, specific to a block of code. Their visibility is only within the block of their declaration. For the class to be useful beyond the declaration block, it would need to implement a more publicly available interface. Because local classes are not members, the modifiers public, protected, private, and static are not usable.

      Anonymous classes – Anonymous inner classes extend local inner classes one level further. As anonymous classes have no name, you cannot provide a constructor.

    9. Question 9. What Is The Difference Between An Interface And An Abstract Class?

      Answer :

      An abstract class can have instance methods that implement a default behavior. An Interface can only declare constants and instance methods, but cannot implement default behavior and all methods are implicitly abstract. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.

    10. Question 10. Describe Synchronization In Respect To Multithreading?

      Answer :

      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.

    11. Question 11. What Are Pass By Reference And Pass By Value?

      Answer :

      Pass by Reference means the passing the address itself rather than passing the value. Passby Value means passing a copy of the value to be passed.

    12. Question 12. What Is Hashmap And Map?

      Answer :

      Map is Interface and Hashmap is class that implements that.

    13. Question 13. Difference Between Hashmap And Hashtable?

      Answer :

      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 unsynchronized and Hashtable is synchronized.

    14. Question 14. Difference Between Vector And Arraylist?

      Answer :

      Vector is synchronized whereas arraylist is not.

    15. Question 15. Difference Between Swing And Awt?

      Answer :

      AWT are heavy-weight components. Swings are light-weight components. Hence swing works faster than AWT.

    16. Question 16. What Is The Difference Between A Constructor And A Method?

      Answer :

      A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator.

    17. Question 17. What Is An Iterator?

      Answer :

      Some of the collection classes provide traversal of their contents via a java.util.Iterator interface. This interface allows you to walk through a collection of objects, operating on each object in turn. Remember when using Iterators that they contain a snapshot of the collection at the time the Iterator was obtained; generally, it is not advisable to modify the collection itself while traversing an Iterator.

    18. Question 18. What Is An Abstract Class?

      Answer :

      Abstract class must be extended/subclassed (to be useful). It serves as a template. A class that is abstract may not be instantiated (ie, you may not call its constructor), abstract class may contain static data. Any class with an abstract method is automatically abstract itself, and must be declared as such. A class may be declared abstract even if it has no abstract methods. This prevents it from being instantiated.

    19. Question 19. What Is Static In Java?

      Answer :

      Static means one per class, not one for each object no matter how many instance of a class might exist. This means that you can use them without creating an instance of a class.Static methods are implicitly final, because overriding is done based on the type of the object, and static methods are attached to a class, not an object. A static method in a superclass can be shadowed by another static method in a subclass, if the original method was not declared final. However, you can’t override a static method with a non-static method. In other words, you can’t change a static method into an instance method in a subclass.

    20. Question 20. What Is Final?

      Answer :

      A final class can’t be extended ie., final class may not be subclasses. A final method can’t be overridden when its class is inherited. You can’t change value of a final variable (is a constant)

    21. Question 21. Are The Imports Checked For Validity At Compile Time? E.g. Will The Code Containing An Import Such As Java.lang.abcd Compile?

      Answer :

      Yes, the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying, cannot resolve symbol

      symbol: class ABCD

      location: package io


    22. Question 22. What Is The Difference Between Declaring A Variable And Defining A Variable?

      Answer :

      In declaration, we just mention the type of the variable and it’s name. We do not initialize it. But defining means declaration + initialization. e.g String s; is just a declaration while String s = new String (“abcd”); Or String s = “abcd”; are both definitions.

    23. Question 23. Objects Are Passed By Value Or By Reference?

      Answer :

      Java only supports pass by value. With objects, the object reference itself is passed by value and so both the original reference and parameter copy both refer to the same object.

    24. Question 24. What Is Serialization?

      Answer :

      Serialization is a mechanism by which you can save the state of an object by converting it to a byte stream.

    25. Question 25. How Do I Serialize An Object To A File?

      Answer :

      The class whose instances are to be serialized should implement an interface Serializable. Then you pass the instance to the Object Output Stream which is connected to a file output stream. This will save the object to a file.

    26. Question 26. Which Methods Of Serializable Interface Should I Implement?

      Answer :

      The serializable interface is an empty interface; it does not contain any methods. So, we do not implement any methods.

    27. Question 27. What Is The Common Usage Of Serialization?

      Answer :

      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 serilazed.

    28. Question 28. What Is Externalizable Interface?

      Answer :

      Externalizable is an interface which contains two methods read External and write External. These methods give you a control over the serialization mechanism. Thus, if your class implements this interface, you can customize the serialization process by implementing these methods.

    29. Question 29. What One Should Take Care Of While Serializing The Object?

      Answer :

      One should make sure that all the included objects are also serializable. If any of the objects is not serializable then it throws a Not Serializable Exception.

    30. Question 30. What Happens To The Static Fields Of A Class During Serialization?

      Answer :

      There are three exceptions in which serialization does not necessarily read and write to the stream.

      • Serialization ignores static fields, because they are not part of any state.
      • Base class fields are only handled if the base class itself is serializable.
      • Transient fields.

    31. Question 31. What Are The Different Ways To Handle Exceptions?

      Answer :

      There are two ways to handle exceptions:

      • By wrapping the desired code in a try block followed by a catch block to catch the exceptions.
      • List the desired exceptions in the throws clause of the method and let the caller of the method handle those exceptions.

    32. Question 32. 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 Approach?

      Answer :

      In the first approach as a programmer of the method, you urself are dealing with the exception. This is fine if you are in a best position to decide should be done in case of an exception. Whereas if it is not the responsibility of the method to deal with its own exceptions, then do not use this approach. In this case use the second approach. In the second approach, we are forcing the caller of the method to catch the exceptions, that the method is likely to throw. This is often the approach library creators use. They list the exception in the throws clause and we must catch them. You will find the same approach throughout the java libraries we use.

    33. Question 33. What Is View Assembly ?

      Answer :

      A window defines the super set of all possible views that a Web Dynpro application could require whilst running a particular component. The number of views visible at any one time however, will typically be only a subset of the number of views embedded within the window.

      The subset of views rendered at any one time is known as the View Assembly. User interaction followed by subsequent navigation processing will frequently cause this subset of views to change with every server round-trip. The view assembly represents those views seen by the user on their client device after the completion of a particular server round trip.

    34. Question 34. What Is Face Less Component ?

      Answer :

      It is a component with zero views and zero windows. Such a component is known as a “faceless” component and is useful when a complex unit of functionality requiring no direct user interaction needs to be encapsulated. A good example of a faceless component is the creation of something called a model component. This is not actually a specific Web Dynpro component type; rather it is a standard Web Dynpro component that has been written specifically for the task of interacting with a model object.

    35. Question 35. What Are The Types Of Controller? Describe ?

      Answer :

      In broad terms, SAP has defined two categories of Web Dynpro controller. The difference between them is simply this: A controller either

      Has a visual interface, or

      Does not have a visual interface.

      SAP has introduced this difference in order to maintain a strict separation between those parts of the business application that display data (typically data consumers), and those parts of the business application that process data (typically data generators).

    36. Question 36. What Are Recursion Nodes ?

      Answer :

      The recursion node is a special type of node used when a node hierarchy with a recursive structure needs to be created. This is needed when, for instance, the depth of the node hierarchy is not known until runtime. Using a recursion node, you can declare that a particular node structure be replicated as a child of itself. A good example here is if your context needs to hold information in the same structure as a file system, containing directories and sub directories.

    37. Question 37. What Is An Empty View ?

      Answer :

      There is a special type of view known as the empty view. This view requires no manual implementation, neither is it possible to interact with it in any way other than invoking its default inbound plug – show Empty View. If you require one particular area of a view set to be empty, then you should embed the empty view into the view area. You can then treat this view just like any other view you have written, except that calling its inbound plug will cause the corresponding view area to be blanked out. If a view set has had no views manually embedded into one of its view areas, then the empty view will be substituted automatically.

    38. Question 38. How Does The Web Dynpro Framework Decide Which Particular Views Make Up The Current View Assembly ?

      Answer :

      When an application is executed for the first time, only those views which have their default flag set to true will belong to the first view assembly.

      Thereafter, user navigation will occur and the view assembly will be composed of those views that have been newly instantiated (on account of their inbound plugs being fired), and those views that persist from the previous view assembly (because no outbound navigation took place from them).

    39. Question 39. Define Webdynpro Controller?

      Answer :

      Controllers are the active parts of a Web Dynpro component. In the design of Web Dynpro controllers, SAP has made a significant modification to the original MVC concept of a controller.

    40. Question 40. If The View Set Concept Is Not Implemented In Web Dynpro For Abap, What Options Are There For Reusing Views ?

      Answer :

      In both Web Dynpro for ABAP and Java, there is a specific UI Element called the View Container. This UI element, when added to a view layout, acts as a container for any other view. View Containers can be arranged in large variety of ways in order to achieve the desired layout on the screen.

      The views that can be embedded into a View Container UI element are the following:

      Any view from the current component

      Any visual interface from a child Web Dynpro component

      An empty view (supplied automatically by the Web Dynpro runtime)

    41. Question 41. What Is A View Set ?

      Answer :

      A view set is a visual framework that subdivides the window into predefined areas. Each subdivision of a view set is known as a view area, and multiple views can be embedded into a single View Area.

      The following preconfigured view sets are available:

      T layout T layout 90o T layout 180o T layout 270o Grid layout Tab strip

      Each subdivision within the view set layout is known as a view area.

    42. Question 42. How Is Model-driven Architecture Implemented In Web Dynpro Framework ?

      Answer :

      Web dynpro framework uses declarative programming techniques to create a meta-model of the application which is free from back-end and front-end programming languages. Rather the metadata is programming language-neutral and has information stored in XML format. It’s only during run-time that the rendering engine generates the code in html and java script from this meta model of the application. So the design part – which defines the UI and data flow between UI elements – is completely abstracted minimizing the coding (which is required only for implementing business logic).

      The model-driven approach helps developer to focus less on coding and technology part and more on the design part of the application – “minimizing coding and maximizing design”. Naturally, the primary focus of business application developer should be the business logic and the technological implementation should not distract him.

    43. Question 43. How Can You Determine Lifespan Of Custom Controllers ?

      Answer :

      The lifespan of a custom controller is determined by a parameter setting made during the design time declaration. It can be either “Framework Controlled” or “On demand”. If you choose “Framework Controlled”, then the Web Dynpro framework will instantiate the custom controller when the component is instantiated. If however, you choose “On demand”, then the Web Dynpro developer must write the coding necessary to instantiate the custom controller.

      Each child component usage is instantiated with a unique name that must be defined at design time. During the lifespan of the parent component, a child component may only ever be instantiated once under a given name; however, should it be necessary, you may declare multiple usages of the same child component as long as you specify different usage names.

    44. Question 44. Explain The Concept Of Lazy Data Access?

      Answer :

      The Web Dynpro framework has been built to follow the principle of Lazy Data Access. This means that the processing required to generate data will not be invoked until the data is actually needed. When this principle is applied to the architecture of the context, it means that unless there is an attempt to access the data in a singleton child node, then even though the lead selection in the parent node has changed, the child node’s supply function will not be called.

    45. Question 45. Before A Mapping Relationship Can Be Established, What Criteria Must Be Met ?

      Answer :

      There must be a suitable node available to act as a mapping origin

Sap Abap Web Dynpro Tutorial

All Tutorials

All Practice Tests

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

SAP ABAP Web Dynpro Tutorial