Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I extend a file?

 
sierra mcgivney
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm totally new to Java, but I have some experience in other languages so some of it transfers, but not much.

I'm currently attempting to resolve an issue I'm having with my code. It's an assignment, and it has three documents.

The error:

Main method not found in class CourseList, please define main method as: Public Static void main(string[] args)


Another Error:

15: error: cannot find symbol
if (course.courseID == id)
^
symbol: variable courseID
location: variable course of type Course
1 error

Tool completed with exit code 1


Main function is on another document. Now, what I gather is that it is looking for the content, but the other files are not linked (so to speak). From my research, they cannot be linked like they might have been in C++. I did find the extend bit, but I'm not really sure how that works.

Would it be included with a path name? Or is it just assuming the files are in the same location?

Document 1:


Document 2:


Document 3:

 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sierra mcgivney wrote:The error:
Main method not found in class CourseList, please define main method as: Public Static void main(string[] args)


You are trying to execute document 1 (the CourseList class) as you main entry point. And that class doesn't have a main() method.

Henry
 
sierra mcgivney
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
sierra mcgivney wrote:The error:
Main method not found in class CourseList, please define main method as: Public Static void main(string[] args)


You are trying to execute document 1 (the CourseList class) as you main entry point. And that class doesn't have a main() method.

Henry


Oh, thank you. That's remarkably silly. For some reason I had it in my head that you had to run it from that document. In any case, issue resolved.

But I do have a question I was hoping you could answer.

Does it automatically search files that are in the same directory folder?
 
Ron McLeod
Saloon Keeper
Posts: 1263
131
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sierra mcgivney wrote:15: error: cannot find symbol
if (course.courseID == id)
               ^
symbol: variable courseID
location: variable course of type Course

Your Course class doesn't have a field named courseID
 
Henry Wong
author
Sheriff
Posts: 22542
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sierra mcgivney wrote:
Does it automatically search files that are in the same directory folder?


Have you learn packages yet? Have you learn about the classpath yet? We can't really answer your question until you understand those concepts first.... but assuming your current code, and you haven't set a classpath, then yes.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!