public class Solution { public static class Idea { public String getDescription() { return "s"; } } public static void printIdea(Idea idea) { System.out.println(idea.getDescription()); } public static void main(String[] args) { printIdea(new Idea()); } } I took help from another answer to this question to solve my problem but I would like to how it works in simple terms. Thank you!