I'm writing an apex code where there are 2 methods and the first method will call the 2nd by passing sObject as a parameter. and below is my code.
public with sharing class MyFirstClass {
public static void getItems(){
List<String> getColumnNames = getColumnNames('TestAssistContact__c');
System.debug(getColumnNames);
}
public static List<String> getColumnNames(sObject obj){
List<String> x = new List<String>();
x.add('Hi');
return x;
}
}
when I run this. I want to print the contents of the list that's returned. But here I get the error as below.
Method does not exist or incorrect signature: void getColumnNames(String) from the type TestAssistClass
please let me know on where am I going wrong and how can I fix it.