Hi to all..
i ask for a little help thanks
here's my problem, i need to call two different strings in the other class and provide any value for it. here's what ive done so far
Here's my first class
public class Student { String Name,Course; public void setNme(String inputName) { Name=inputName; } public String getNme() { return Name; } public void setCrs(String inputCourse) { Course=inputCourse; } public String getCrs() { return Course; } }
Here's the other one that call the Student Class
public class Outcome { public static void main(String[]args) { Student a = new Student(); a.setNme("charles"); System.out.print(a.getNme()); Student b = new Student(); b.setCrs("\ncB.S. Computer Science"); System.out.print(b.getCrs()); } }
I can call the first String which is Name but the second one which is Course i always get an error. any help would do but please dont use advance scripts, just the basic only thanks.
Here's the error message i get.