//How to create a class and access it from another Job
//Class Declaration:
public class Class1
{
str firstName;
}
//Method:
public void setFirstName(str _firstName)
{
firstName = _firstName;
}
// Method:
public str getFirstName()
{
return firstName;
}
// Job:
/*
We will access our class using this below JOB
Class1 is present in the class section
*/
public static void runYourOwnClass(Args _args)
{
Class1 c1;
str name;
c1 = new Class1();
c1.setFirstName("My Name");
name = c1.getFirstName();
info(strFmt("%1",name));
}
My Name
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.
Sign in to save your progress and continue exactly where you left off.