How to write a java code in an activity? Explain with a small example.



How to write a java code in an activity? Explain with a small example...

Answer / Ankur Gupta

To write Java code in an activity, you can use the 'Java Class' activity. Here's a small example: Let's assume we want to calculate the sum of two numbers within an activity. You would create a new 'Java Class' activity and write the following Java code: public int addNumbers(int num1, int num2) { return num1 + num2; } Then, you can call this method from within another activity using the 'Invoke Method' activity.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Pega Interview Questions

How to connect to different pega applications?

1 Answers  


Define about rdb-list method?

1 Answers  


How do we create an agent?

1 Answers  


Consider this scenario: I need to generate a list view report of all the work objects created on a particular date and then I need to include this list view in a section. How can this be done?

1 Answers  


List different functions used to call an activity from java script.

1 Answers  


Difference between file listener and connect file?

1 Answers  


If I have 3 different work objects in my application, how to store them in three different tables?

1 Answers  


How can I store the instance of the class in the database?

1 Answers  


What is Pega and Why Pega?

1 Answers  


How do you create MQ in PRPC?

1 Answers   Accenture,


What is the programming skills needed for Pega RPA?

1 Answers  


Explain about the rdb-list method?

1 Answers  


Categories