Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

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

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

2.

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.

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.

3.

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.

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.

4.

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.

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.

5.

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.

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.

6.

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)

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)

7.

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.

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.

8.

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

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

9.

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.

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.

10.

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.

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.

11.

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

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

12.

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.

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.

13.

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.

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.

14.

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.

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.

15.

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.

There are two ways to handle exceptions:

16.

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.

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

17.

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.

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.

18.

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.

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.

19.

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.

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.

20.

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.

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

21.

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.

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.

22.

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.

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.

23.

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

import java.io.ABCD;

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

import java.io.ABCD;

24.

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)

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)

25.

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.

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.

26.

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.

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.

27.

Difference Between Swing And Awt?

Answer»

AWT are heavy-weight COMPONENTS. SWINGS are light-weight components. Hence SWING works faster than AWT.

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

28.

What Is Hashmap And Map?

Answer»

MAP is INTERFACE and HASHMAP is CLASS that IMPLEMENTS that.

Map is Interface and Hashmap is class that implements that.

29.

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.

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.

30.

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.

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.

31.

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 java.io.FileInputStream’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.

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 java.io.FileInputStream’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.

32.

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.

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.

33.

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

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

34.

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

Answer»

PROGRAM COMPILES but THROWS a RUNTIME ERROR “NoSuchMethodError”.

Program compiles but throws a runtime error “NoSuchMethodError”.

35.

What If I Write Static Public Void Instead Of Public Static Void?

Answer»

PROGRAM COMPILES and RUNS PROPERLY.

Program compiles and runs properly.

36.

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.

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