You need to sign in to do that
Don't have an account?
Sales Force FRM
Unable to make use of List as it's generating compile time issues
Hi Folks,
I am Unable to make use of List as it's generating compile issues , ,y program is as follows:
1 public class ListDemo
2 {
3 List<Integer> MyList = new List<Integer>(); // Define a new list
4 MyList.add(47); // Adds a second element of value 47 to the end
5 List.get(0); // Retrieves the element at index 0
6 MyList.set(0, 1); // Adds the integer 1 to the list at index 0
7 MyList.clear(); // Removes all elements from the list
8
9 }
and i got following compile time errors:
Error: Compile Error: unexpected token: 47 at line 4 column 16
iam running apex scripts from the from the following links:
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
I have a developer edition account , I have tried so many code samples (Please refer code samples in the above link)
but all most all i got compile time errors like above!, please suggest me what i have to do?
Regards,
Rajeshwar.
I am Unable to make use of List as it's generating compile issues , ,y program is as follows:
1 public class ListDemo
2 {
3 List<Integer> MyList = new List<Integer>(); // Define a new list
4 MyList.add(47); // Adds a second element of value 47 to the end
5 List.get(0); // Retrieves the element at index 0
6 MyList.set(0, 1); // Adds the integer 1 to the list at index 0
7 MyList.clear(); // Removes all elements from the list
8
9 }
and i got following compile time errors:
Error: Compile Error: unexpected token: 47 at line 4 column 16
iam running apex scripts from the from the following links:
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
I have a developer edition account , I have tried so many code samples (Please refer code samples in the above link)
but all most all i got compile time errors like above!, please suggest me what i have to do?
Regards,
Rajeshwar.
Message Edited by TehNrd on 05-21-2008 09:28 AM
public class listTest{
public void intList {
List myList = new List();
myList.add(23);
}
}
Edit: Duh, I have variables defined in the class but no code. I should have caught that.
Message Edited by TehNrd on 05-21-2008 11:31 AM