| Author |
Preparing for the SCJA
|
Tuesday Ganal
Greenhorn
Joined: Oct 27, 2010
Posts: 12
|
|
|
Hi guys, I'm preparing for SCJA and I saw this exam topic about Concrete Classes. What is a concrete class. I can't seem to find it in the Java documentation, and even in my Java complete curriculum. Anybody can help me in finding a site where I can get info on concrete classes? Thanks so much.
|
 |
Triguna Mutuguppe Sripathi
Greenhorn
Joined: Jun 20, 2008
Posts: 3
|
|
http://www.brpreiss.com/books/opus5/html/page610.html
Hope this helps.
|
Triguna
http://techobuzz.wordpress.com
|
 |
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Joined: Aug 26, 2006
Posts: 4962
|
|
|
Really, a concrete class is one that is not abstract. If you can create an instance of a class by invoking its contstructor, it's concrete!
|
Author of Hibernate Made Easy, What is WebSphere???, JSF 2.0 Made Easy and the SCJA Certification Guides
|
 |
Mala Gupta
Ranch Hand
Joined: Sep 27, 2002
Posts: 126
|
|
The following is an example of a concrete class:
You can create instances of this class as follows:
However, if you prefix the definition of class Person with the keyword abstract, it will then be termed as an abstract class, as follows:
Now, the following code will not compile:
The compiler will complaint that it cannot create objects of an abstract class. An abstract class, as its name suggests, is an incomplete representation of a concept. Hence, creation of its objects isn't allowed.
cheers
Mala
|
SCWCD, SCJP
|
 |
Tuesday Ganal
Greenhorn
Joined: Oct 27, 2010
Posts: 12
|
|
Cameron Wallace McKenzie wrote:Really, a concrete class is one that is not abstract. If you can create an instance of a class by invoking its contstructor, it's concrete!
Thanks, Cameron. BTW, I'm reading your book SCJA Certification Guide.
|
 |
Tuesday Ganal
Greenhorn
Joined: Oct 27, 2010
Posts: 12
|
|
Triguna Mutuguppe Sripathi wrote:http://www.brpreiss.com/books/opus5/html/page610.html
Hope this helps.
Thanks, Triguna
|
 |
Tuesday Ganal
Greenhorn
Joined: Oct 27, 2010
Posts: 12
|
|
Mala Gupta wrote:The following is an example of a concrete class:
You can create instances of this class as follows:
However, if you prefix the definition of class Person with the keyword abstract, it will then be termed as an abstract class, as follows:
Now, the following code will not compile:
The compiler will complaint that it cannot create objects of an abstract class. An abstract class, as its name suggests, is an incomplete representation of a concept. Hence, creation of its objects isn't allowed.
cheers
Mala
Thanks, Mala for differetiating an abstract from a concrete class. It helps
|
 |
Mala Gupta
Ranch Hand
Joined: Sep 27, 2002
Posts: 126
|
|
I am glad, it does. A simple example is much more effective than reading 2 pages of theory.
cheers
Mala
|
 |
 |
|
|
subject: Preparing for the SCJA
|
|
|