java - Error message "cannot find symbol" -
I am quite new to Java and programming. I'm using the textbook "How to program a Java". I am solving a practice (3.11 p 136). In this exercise, I am trying to get an application with two sections to print information about a gradebook. It is considered to print two teals for each of the two objects of the class, with information: "The gradebook is the name of the course: Introduction to CS101 Java Programming, Coach Donald Duck". Some other information for Gradebook 2 I have to meet and use set-methods, and use a constructor. I have not arranged to compile "Gradebook Test Class", which contains the main method I get the following error message:
aGradeBookTest.java:8: can not find the symbol symbol : Variable gradebook1 location: class aGradeBookTest System.out.printf ("Gradebook 1 is the name of the course: stressed on text% s, \ n instructor% s \ n", gradebook1.getCourseName (), gradebook 1.getInstructorName ()) ; ^ Agradebooktest.java:9: The symbol symbol can not be found: method getInstructorname () Location: class aGradeBook System.out.printf ("The gradebook 2 is the name of the course:% s \ n, the name of the trainer is:", Gradebook 2 .getCourseName (), Gradebook2 .getInstructorname ()); ** The following are the codes for the two classes:
public class aGradeBook {personal string stringname; Private string instructorName; Public aGradeBook (string name, string iName) {courseName = name; InstructorName = iName; } Public ZeroServer Name (string name) {courseName = name; } Public string getCourseName () {return courseName; } Public Zero setInstructorName (string iName) {iName = instructorName; } Public string getInstructorName () {return instructorName; } Public Zero Display Message () {System.out.printf (Welcome to Gradebook for \ n% s! \ N ", getCourseName ()); }} and:
public class aGradeBookTest {public static void main (string [] args) {aGradeBook gradebook1 = new aggregate ("CS101 Introduction Java Programming "," Donald Duck "); Aggregate Gradebook 2 = New Agribabe ("Data structure in CS 102 Java", "Tom and Jerry"); System.out.printf ("Gradebook 1 is the name of course:% s, \ n instructor% s \ n", Gradebook 1.getCourseName (), Gradebook 1.getInstructorName ()); System.out.printf ("The name of the gradebook 2 course is:% s \ n, the name of the trainer is:", Gradebook 2.getCourseName (), Gradebook 2. getInstructorname ()); }} Can someone please help me, I'm stuck here?
In your code instead of Gradebook 1 you gradebook 1 < / Code> is written Gradebook 1 variable is not present and this is the compiler that is telling you: symbol symbol can not be found: variable gradebook1 .
Comments
Post a Comment