• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

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.
0
scJohn
Asked:
scJohn
  • 8
  • 5
  • 4
2 Solutions
 
CEHJCommented:
YOu need to check the methods of stereoType and make sure you have the case right
0
 
CEHJCommented:
In Java a private field 'x' should have an accessor called getX() and a mutator called setX()
0
 
scJohnAuthor Commented:
that was the first thing i checked. It still shows the same errors.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
zzynxSoftware engineerCommented:
>>YOu need to check the methods of stereoType and make sure you have the case right
In other words:
Does your class stereoType has the public methods
getname(), getcatNum(), getprice() and getquantityAvailable()?
0
 
zzynxSoftware engineerCommented:
>> 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?
0
 
scJohnAuthor Commented:
thats the problem, thanks guys
0
 
zzynxSoftware engineerCommented:
>> thats the problem
What's the problem?
0
 
CEHJCommented:
(Which is what i said at first). scJohn, can you tell me why you accepted that comment as the only answer please?
0
 
zzynxSoftware engineerCommented:
>> 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 ;°)
0
 
scJohnAuthor Commented:
sorry, how do you except more than one answer? im new at this.
0
 
zzynxSoftware engineerCommented:
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 http://www.experts-exchange.com/Community_Support/

Subject: Moderator Please Reopen
Body: Please reopen this question:
http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_21412265.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.
0
 
scJohnAuthor Commented:
ok, i will do that. again sorry.
0
 
zzynxSoftware engineerCommented:
>> again sorry
No problem.
0
 
zzynxSoftware engineerCommented:
isn't it CEHJ?
;°)
0
 
CEHJCommented:
Yes, thanks.
0
 
CEHJCommented:
:-) and thank you zzynx
0
 
zzynxSoftware engineerCommented:
:)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 8
  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now