Search Results

Showing results 1 to 8 of 8
Search took 0.01 seconds.
Search: Posts Made By: new_2_java
Forum: Java Apr 30th, 2008
Replies: 8
Solved: java code help
Views: 839
Posted By new_2_java
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
Posted By new_2_java
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
Posted By new_2_java
- 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
Posted By new_2_java
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
Posted By new_2_java
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
Posted By new_2_java
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
Posted By new_2_java
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
Posted By new_2_java
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('*');
}
...
Showing results 1 to 8 of 8

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC