• Post Reply Bookmark Topic Watch Topic
  • New Topic

What is a tester class ?  RSS feed

 
Daniel Vargas
Greenhorn
Posts: 17
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I'm beginning to learn java with the book HeadFirst Java
The books says that all a tester class does is create objects of a new type and then use the dot operator...
I don't really understand what a tester class is, would some please tell me in his/her own words what a tester class is and what it does ? and what is the Dot operator and how does it work ?
THANK YOU.
 
Anuj Sharma R
Greenhorn
Posts: 28
1
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the CodeRanch Daniel.

Tester class contains the main function and it is from where your program starts running. It can be any class having main function where in you can call your newly created class objects. It is just that HeadFirst book is giving you this terminology to make it easier for you to learn and implement.

In the example you mentioned - Prior to the tester class - you might have created a Dog class which is your depiction of a real world object. In order to test this class, you need a starting point for execution. In Java starting point is main function. Either you can create a main function in the same class or create any new class (in this case it is named tester, but you can name it anything) with main function to test or execute or newly created class.

I would suggest that you implement this practically and spend some time on the examples which would make it clearer for you.

 
Tony Docherty
Bartender
Posts: 3271
82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

As for the dot operator I suggest you read http://docs.oracle.com/javase/tutorial/java/javaOO/usingobject.html.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!