Whats the frequency of the letter i in:
Q: how to call with inherited class in parent class below is the code what i am trying is to fetch contact record in without sharing mode.
commented part has the problem and it showing 

Method does not exist or incorrect signature: void
  InheritedSharingClass() from the type
  ParentClass.InheritedSharingClass

 public without sharing class ParentClass{

 public inherited sharing class InheritedSharingClass {
    public List<Contact> getAllTheSecrets(){
        return [SELECT name,owner.name FROM Contact];
    }
 }

public ParentClass(){
   // ParentClass.InheritedSharingClass childcls = new ParentClass.InheritedSharingClass();
      //  childcls.InheritedSharingClass();
      }
 }


A: Method InheritedSharingClass does not exist in your class, probably you are trying to access getAllTheSecrets so your code will be like
public without sharing class ParentClass{

 public inherited sharing class InheritedSharingClass {
    public List<Contact> getAllTheSecrets(){
        return [SELECT name,owner.name FROM Contact];
    }
 }

public ParentClass(){
    ParentClass.InheritedSharingClass childcls = new ParentClass.InheritedSharingClass();
        childcls.getAllTheSecrets();
      }
 }


user
I counted 76 "i"s in that text.
assistant