Forum: Java Apr 30th, 2008 |
| Replies: 8 Views: 839 You are almost there:
According to your requirements, in your constructor, you also need to pass a boolean variable; so, your constructor looks something like this:
public TFQuestion(String... |
Forum: Java Apr 11th, 2008 |
| Replies: 6 Views: 674 You need this:
public class DemoAges
{
private Ages ages = new Ages();
public static void main(String[] args)
{
//Declare/initialize Ages
int age = 0; |
Forum: Java Mar 14th, 2008 |
| Replies: 7 Views: 7,822 - Open a command prompt
- Type in: date
- it prompts you for new date/time
- enter new values. |
Forum: Java Mar 7th, 2008 |
| Replies: 5 Views: 939 You cannot compare string with number, the way you are doing it. however you can compare strings with equals() or equalsIgnoreCase() methods of String.
What is it that you try to compare, e.g. 0... |
Forum: Java Feb 28th, 2008 |
| Replies: 11 Views: 2,404 Do you ever call the calculateAre of Triangle and Rectangle? you should call calculateArea to actually calculate and assing new value to area e.g.
class TwoDShapeDriver
{
public static void... |
Forum: Java Feb 28th, 2008 |
| Replies: 11 Views: 2,404 In your calculateArea don't use a local instance, and set your class variable "area" to the newly calculated value like:
area = getHight() * getWidth... |
Forum: Java Feb 26th, 2008 |
| Replies: 11 Views: 2,404 In your caculateArea() you should use the getter method of your TwoDShape class to obtain the hight and width and not directly since they are private to TwoDShape. You can do something like this:
... |
Forum: Java Feb 15th, 2008 |
| Replies: 5 Views: 984 Or for 2nd one, add the following right after your for() loop:
for (j=0;j <triangleSize;j++ ) {
for(k=triangleSize-1;k>j;k--){
System.out.print('*');
}
... |