Java OOPObject-Oriented Programming.ExamplesOOP ConceptCreating a simple instance of a class.// Simulating Class and Object class Fruit { String name; } public class Main { public static void main(String[] args) { Fruit apple = new Fruit(); apple.name = "Apple"; System.out.println(apple.name); } } Try it YourselfTest Your KnowledgeJava QuizNo quiz available for this topic yet.PreviousNext