Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Trouble with Total Beginner tutorial lesson 3... SOLVED(following steps results in this dialog...)
icon8.gif  Trouble with Total Beginner tutorial lesson 3... SOLVED [message #901896] Tue, 14 August 2012 22:24 Go to next message
Ian Lewis is currently offline Ian Lewis
Messages: 3
Registered: August 2012
Junior Member
Mad Scrapbook view displays this when inspected as per instructions in video 3.

The method setName(String) is undefined for the type Person
The method getMaximumBooks(int) is undefined for the type Person
The method getName() is undefined for the type Person

Person p = new Person();
p.setName("Fred");
p.getMaximumBooks(10);
p.getName()


I have double checked the training documentation to see if I typed anything wrong, along with the checking the videos again. I still get this output which is not what the video displays. I do not understand this well enough yet to fix...any pointers?

This is the code I typed per instruction from the video, I didnt see anything wrong.

package org.totalbeginner.tutorial;

public class Person {
// fields
private String name; // name of the person
private int maximumBooks; // most books the person can check out

// constructors
public Person() {
name = "unknown name";
maximumBooks = 3;
}

//methods
public String getName() {
return name;
}

public void setName(String anyName) {
name = anyName;
}

public int getMaximumBooks() {
return maximumBooks;
}

public void setMaximumBooks(int maximumBooks) {
this.maximumBooks = maximumBooks;
}

}



after trying to set eclipse as default program and double checking the default JDE I am still in the undefined string error...........ANYBODY KNOW WHY?! its hard to learn this from the video if im getting dialog telling me im doing something wrong. SOME ONE HELP A NEWCOMER OUT PLEASE

UPDATE: SAVE YOUR STUFF BEFORE RUNNING/INSPECTING, tip for all newbs

keywords: eclipse, lesson3, lesson03, lesson 3, undefined method, total beginners, java, error,

[Updated on: Wed, 15 August 2012 00:35]

Report message to a moderator

Re: Trouble with Total Beginner tutorial... [message #901898 is a reply to message #901896] Tue, 14 August 2012 22:41 Go to previous messageGo to next message
Ian Lewis is currently offline Ian Lewis
Messages: 3
Registered: August 2012
Junior Member
.....why does it keep saying the methods are undefined ......................................ANYBODY?
Re: Trouble with Total Beginner tutorial... [message #901903 is a reply to message #901898] Tue, 14 August 2012 23:19 Go to previous messageGo to next message
Ian Lewis is currently offline Ian Lewis
Messages: 3
Registered: August 2012
Junior Member
anybody!?!?!?!?!!?!?!?
Re: Trouble with Total Beginner tutorial... [message #901912 is a reply to message #901896] Wed, 15 August 2012 01:41 Go to previous message
David Wegener is currently offline David Wegener
Messages: 1341
Registered: July 2009
Senior Member
On 08/14/2012 05:24 PM, Ian Lewis wrote:
> Scrapbook view displays this when inspected as per instructions in video 3.
>
> The method setName(String) is undefined for the type Person
> The method getMaximumBooks(int) is undefined for the type Person
> The method getName() is undefined for the type Person
> Person p = new Person();
> p.setName("Fred");
> p.getMaximumBooks(10);
> p.getName()
> I have double checked the training documentation to see if I typed
> anything wrong, along with the checking the videos again. I still get
> this output which is not what the video displays. I do not understand
> this well enough yet to fix...any pointers?
>
> This is the code I typed per instruction from the video, I didnt see
> anything wrong.
>

First, you need to be a little patient. You can't expect an immediate
response in the forums. We are all volunteers here so we aren't
constantly checking to see if someone needs help.

My first guess is that you either haven't saved the file or don't have
auto build turned on so the file hasn't been compiled.

Another possibility is that you have another Person class defined. The
code you included is in a package. However, you don't indicate that you
specified a package qualifier in the scrapbook snippet. Unless you have
set the package on the scrapbook page, it is going to be looking for a
Person class in the default package. That doesn't match the one you
included in your post.
Previous Topic:Disable popup alert in MAT
Next Topic:Can't connect to discovery source
Goto Forum:
  


Current Time: Fri Sep 19 11:56:16 GMT 2014

Powered by FUDForum. Page generated in 0.02197 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software