function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion 

getUserInfo() method error

public class ToKnowUserInfo{

public void doGetUserInfo() {
try {
GetUserInfoResult result =connection.getUserInfo();
System.out.println('\nUser Information');
System.out.println('\tFull name: ' + result.getUserFullName());
System.out.println('\tEmail: ' + result.getUserEmail());
System.out.println('\tLocale: ' + result.getUserLocale());
System.out.println('\tTimezone: ' + result.getUserTimeZone());
System.out.println('\tCurrency symbol: ' + result.getCurrencySymbol());
System.out.println('\tOrganization is multi-currency: ' +
} catch (ConnectionException ce) {



While i compile this code i get error 
"Error: Compile Error: Invalid type: GetUserInfoResult at line 5 column 7" what is the reason ............knoe any ple tell me  

                                                                                                                                                                                                           thank u


you have to use System.debug(), java doesn't work for apex




Well seems like you havent imported the necessary libraries and namespaces.

Try using the content assist to select "GetUserInfoResult" this will import the necessary files
i am not geting clarity , can elaborate ? what u said above
GetUserInfoResult belongs to namespace. You need to import the namespace in you project to use them.

But if you are not sure about the namespace Eclipse has a content assist feature, which gives you suggestion based on what you type in. We generally use "CTRL + SPACE" to invoke the same. When you select the required class from the content assist all the dependencies are automatically imported into your project