• Bhavya
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

i ran the below program in Apex  but i am getting error so please could you help me.

 

public  class SimpleArrayClass
{public static  integer findSum(Integer[]a)
{
Integer s=0;
for(integer x:a)
{s=s+x;
  }
 
 
return s;
}

  }

--------------------

 

@isTest
public class SimpleArrayTestClass
{
 @isTest Static Void sumTest()
{
Integer [] a=new Integer[4]{10,20,30,40};
integer act=0,exp=100;
act=SimpleArrayClass.findsum(a);
system.debug('Actual Value...' +act);
}
}

  • September 07, 2012
  • Like
  • 0

i ran the below program in Apex  but i am getting error so please could you help me.

 

public  class SimpleArrayClass
{public static  integer findSum(Integer[]a)
{
Integer s=0;
for(integer x:a)
{s=s+x;
  }
 
 
return s;
}

  }

--------------------

 

@isTest
public class SimpleArrayTestClass
{
 @isTest Static Void sumTest()
{
Integer [] a=new Integer[4]{10,20,30,40};
integer act=0,exp=100;
act=SimpleArrayClass.findsum(a);
system.debug('Actual Value...' +act);
}
}

  • September 07, 2012
  • Like
  • 0