You need to sign in to do that
Don't have an account?
TheLearner
regarding my code
Hi Experts,
Im salesforce admin, im learning development also , just im practising java code in salesforce, while trying i developed this code ,i dont know whats wrong is there in this code,please help me out. really im nothing in coding. Thanks in adavance.
public class learn
{
int n;
int result;
public void set(int x)
{
n=x;
}
public void display()
{
for(int i=1;i<10;i++)
{
result=n*i;
system.debug(result);
}
}
}
public class mul
{
learn emp= new learn();
emp.set(2);
emp.display();
}
Im salesforce admin, im learning development also , just im practising java code in salesforce, while trying i developed this code ,i dont know whats wrong is there in this code,please help me out. really im nothing in coding. Thanks in adavance.
public class learn
{
int n;
int result;
public void set(int x)
{
n=x;
}
public void display()
{
for(int i=1;i<10;i++)
{
result=n*i;
system.debug(result);
}
}
}
public class mul
{
learn emp= new learn();
emp.set(2);
emp.display();
}
All Answers
First of all your variable declaration is not correct. You have to declare your variable as Integer n not int n.
Thanks for the reply yes i got it whr i did wrong, see this is my latest code which is error free, please try to give me some docs so that i can improve my development skills.
public class learn
{
integer n;
integer result;
public void set(integer x)
{
n=x;
}
public void display()
{
for(integer i=1;i<10;i++)
{
result=n*i;
system.debug(result);
}
}
public void temp()
{
learn emp= new learn();
emp.set(2);
emp.display();
}
}
https://www.salesforce.com/us/developer/docs/apexcode/
please provide me visualforce pages with combination of apex code so that , beginers like me can learn please