Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone please explain what I am doing wrong? Object creation Create an object of Student' class and call display function. Output Object created successfully
Can someone please explain what I am doing wrong?
Object creation Create an object of Student' class and call display function. Output Object created successfully display function called successfully + Test Case(s) Default Score Weight: 100% Compiler: Java Student.java Student.java entrypoint.cz 1 import java.util.*; 3. public class Student { public static void main(String[] args) { Student s = new Student(); s.display(); class Student { public Student() { System.out.println("Object created successfully"); public void display() { System.out.println("display function called successfully"); } 15 16 } + Add Custom Test Case OUTPUT CODE REVIEW COMMENT A Error Student.java:6: error: cannot find symbol s.display(); symbol: method display() location: variable s of type Student Student.java:7: error: class Student is already defined in package unnamed package class Student {Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started