Link to home
Start Free TrialLog in
Avatar of scJohn
scJohn

asked on

errors with .get

hello, i  have a test program for a class. I am getting errors for every line that i have I use ".get". All errors say "TeststereoType.java [10:1] cannot resolve symbol" and point to  ".get"
this is what i have:

//class: TeststereoType
public class TeststereoType
{
      public static void main(String [] args)
      {
            //Test defualt construtor, accessor moethods
            //mutator methods, and equals method
            stereoType stereoType1 = new stereoType();//invoke default constructor

            System.out.println("Name: " + stereoType1.getname());
            System.out.println("Cataloge Numer: " + stereoType1.getcatNum());
            System.out.println("Price: " + stereoType1.getprice());
            System.out.println("Quantity on hand: " + stereoType1.getquantityAvailable());
            System.out.println();

            stereoType1.setname("Kenwood");
            stereoType1.setcatNum("N0512");
            stereoType1.setprice("87.99");
            stereoType1.setquantityAvailable("5");

            System.out.println("Name: " + stereoType1.getname());
            System.out.println("Cataloge Numer: " + stereoType1.getcatNum());
            System.out.println("Price: " + stereoType1.getprice());
            System.out.println("Quantity on hand: " + stereoType1.getquantityAvailable());
            System.out.println();

Am i doing something realy stupid or do you think its in the other class? i cant figure this out.
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In Java a private field 'x' should have an accessor called getX() and a mutator called setX()
Avatar of scJohn
scJohn

ASKER

that was the first thing i checked. It still shows the same errors.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>> I am getting errors for every line that i have I use ".get".
So the first line with an error is
>> System.out.println("Name: " + stereoType1.getname());
Right?

Can you post the code of your stereoType class?
Avatar of scJohn

ASKER

thats the problem, thanks guys
>> thats the problem
What's the problem?
(Which is what i said at first). scJohn, can you tell me why you accepted that comment as the only answer please?
>> can you tell me why you accepted that comment as the only answer please?
Hi CEHJ, that's exactly what I was going to ask as the next question ;°)
Avatar of scJohn

ASKER

sorry, how do you except more than one answer? im new at this.
But before you can re-accept this question, it should first be reopened by a moderator or page editor.
To reopen this question, post a zero-point question in https://www.experts-exchange.com/Community_Support/

Subject: Moderator Please Reopen
Body: Please reopen this question:
https://www.experts-exchange.com/questions/21412265/errors-with-get.html


>> im new at this
Then reading the Help would be a good idea.

>> how do you except more than one answer?
I quote from the help pages:

More than one Expert helped solve my problem. What do I do?
 
You split the points. Scroll down to the bottom of the question and click the "Split Points" link at the bottom of the page.
Select the radio button of the comment who you want to Accept as the answer.
Only one button can be selected. Set the point value (a text box above the comment) of how much you want this person
to receive of the points.
Then set the point values for each of the experts comments to whom you want to allocate points
and these will be considered Assisted answers in helping you resolve the issue.
Double check your information and then click the Submit button at the bottom of the page.
One note: the total points of the splits must equal the amount you asked the question for itself,
and no person can receive fewer than 20 points.
Avatar of scJohn

ASKER

ok, i will do that. again sorry.
>> again sorry
No problem.
isn't it CEHJ?
;°)
Yes, thanks.
:-) and thank you zzynx
:)