Interview Questions

Q:

How to get contents of the folder?

Answer

File[] listFiles();


this method returns list of files stored in a directory.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2053
Q:

When should I use abstract classes and when should I use interfaces?

Answer

Use Interfaces when…


- You see that something in your design will change frequently.


- If various implementations only share method signatures then it is better to use Interfaces.


- You need some classes to use some methods which you don't want to be included in the class, then you go for the interface, which makes it easy to just implement and make use of the methods defined in the interface.


 


Use Abstract Class when…


- If various implementations are of the same kind and use common behavior or status then abstract class is better to use.


- When you want to provide a generalized form of abstraction and leave the implementation task with the inheriting subclass.


- Abstract classes are an excellent way to create planned inheritance hierarchies. They're also a good choice for nonleaf classes in class hierarchies.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2052
Q:

What is the main reason of using process lifecycle in Android?

Answer

The android system will keep all the process that are hosting the services together at one place till the time the service is not started or connected to the client. The priority of the process is divided when running low on memory or when the process has to be killed. The process lifecycle is as follows:
- The service is running currently then the methods onCreate(), onStartCommand(), and onDestroy()methods, will run in the foreground to execute the process without being killed.
- The service is already started then the process can be considered as less important then the processes that are currently visible and used. This is done as there are only few processes that are visible to the users on the screen.
- The clients are bounded to the services they are providing requires more priority in the execution list.
- The service that is started uses startForeground(int, Notification)API to allow all the services to run in the foreground state. The system considers only the services where the user is still active as the services not to be killed.

Report Error

View answer Workspace Report Error Discuss

1 2052
Q:

Demand side market failures occur when

A) supply curves do not reflect the full cost of producing a good or services B) demand curves do not reflect consumer’s full willingness to pay for goods or services
C) government imposes tax on a good or a service D) a good or service is not produced because no one demands it
 
Answer & Explanation Answer: B) demand curves do not reflect consumer’s full willingness to pay for goods or services

Explanation:

Market failure arises because it is not possible for the market to correctly weight cost and benefits in a situation in which some of the cost is completely unaccounted.

Demand-side market failures happen when demand curves do not reflect consumer’s full willingness to pay for goods or services.

Supply-side market failures occur when supply curves do not reflect the full cost of producing a good or services.

Report Error

View Answer Report Error Discuss

Filed Under: Marketing and Sales
Exam Prep: Bank Exams , CAT
Job Role: Analyst , Bank Clerk , Bank PO

1 2051
Q:

What is the use of tostring() method?

Answer

If we print any object by using println() or print() methods.


The println() or print() methods internally calls tostring() method and prints the return value of toString() method.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2050
Q:

What is an abstract class?

Answer

An abstract class is an incomplete class. An abstract class is defined with the keyword abstract . We cannot create an object of the abstract class because it is not complete. It sets a behavioral protocol for all its child classes.

Report Error

View answer Workspace Report Error Discuss

Subject: Java

0 2050
Q:

What are the events in ABAP language?

Answer

1. Initialization
2. At selection-screen
3. Start-of-selection
4. End-of-selection
5. Top-of-page
6. End-of-page
7. At line-selection
8. At user-command
9. At PF
10. Get
11. At New
12. At LAST
13. AT END
14. AT FIRST


1. Initialization
2. At selection-screen
3. Start-of-selection
4. End-of-selection
5. Top-of-page
6. End-of-page
7. At line-selection
8. At user-command
9. At PF
10. Get
11. At New
12. At LAST
13. AT END
14. AT FIRST - See more at: https://www.aired.in/2010/06/part-6-sap-abap-interview-questions-and.html#sthash.q4iDHrxe.dpuf
Report Error

View answer Workspace Report Error Discuss

Subject: ABAP

0 2047
Q:

How do you calculate gratuity?

Answer

Gratuity is paid to all such employees after their resignation or retirement.Incase of resignation gratuity is paid to such employees who have completed 5 years of service.


Calculation of gratuity = Basic + DA x (15/26) x Total no. yrs service


15- Half month


26- Excluding 4 sundays

Report Error

View answer Workspace Report Error Discuss

1 2044