1
votes

Sorry, I'm sure this is some rookie istake I'm making but I have a MVC pattern package which keeps returning this errors to me:

======================================
hrms.java:22: error: cannot find symbol
        hrmsModel HRMSModel = new hrmsModel();
        ^
  symbol:   class hrmsModel
  location: class HRMS
hrms.java:22: error: cannot find symbol
        hrmsModel HRMSModel = new hrmsModel();
                                  ^
  symbol:   class hrmsModel
  location: class HRMS
hrms.java:24: error: cannot find symbol
        hrmsView view = new hrmsView(HRMSModel);
        ^
  symbol:   class hrmsView
  location: class HRMS
hrms.java:24: error: cannot find symbol
        hrmsView view = new hrmsView(HRMSModel);
                            ^
  symbol:   class hrmsView
  location: class HRMS
4 errors
=======================================

Would really appreciate if you could tell me what I was doing wrongly here...Thanks in advance! I've added the code for the main package of my class hrms MVC gui below, for your reference.

4
Share your package name and class name for hrms - Juned Ahsan
I added them, kindly take a look - dizzyone
check my answer, your object creation syntax is wrong. - Juned Ahsan
Java Tutorial is a better place to learn Java. Posting syntax errors on SO will no get you very far. - Oleg Estekhin

4 Answers

0
votes

hrmsModel HRMSModel = new hrmsModel(); seems like its not arrange properly.

I think the right arrarangement is this YourClass yourVariable = new YourClass()

0
votes

First, check if you have the classes hrmsModel and hrmsView in the same package as HRMS. If you don't have them, you should import them.

On a side note, it's best if you follow the Java naming convention and name your class HRMSModel and your variable hrmsModel. If you are following that convention, then you might be confusing the order of both and that's why the compiler complains.

0
votes

Syntax for object creation is:

ClassName instanceName = new ClassName();

So change this

hrmsModel HRMSModel = new hrmsModel();

to:

HRMSModel hrmsModel = new HRMSModel();
0
votes

Under hrms package you have HRMS* java, but you are trying to create object for hrms* classes.

Change name and execute.