Win a copy of Rust Web Development this week in the Other Languages forum!

Pete Low

Greenhorn
+ Follow
since May 25, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Pete Low

Hi,

I heard people talk about Java5.
Understand there is Ver1.5.
Do they mean the same thing?

Rgds
16 years ago
Hi,

Can anyone assist what can I do if the numerator is zero ?

int dolM1 = ( diffTot / 100 ) ;

Rgds

16 years ago
Hi,

Have tested out the codes.
Does not seem to be any problem.
The result is as follows:-


Playing the movie
Press any key to continue . . .
16 years ago
Polymorphism?

The ability to associate many meanings to one method by means of the late binding mechanism.
16 years ago
JVM?
Simply a fictitious computer - similar to all typical computers - which has a machine language called byte-code
16 years ago
Hi,

I am checking how I can call a method getFarenH(double degreesC )
from another method.

Below is the relevant portion of the class temperature.
Thnks


class Temperature {
private double value;
private char scale;

// some constructors

// Mutator Methods



public double getFarenH(double degreesC )
{
double degreesF = 0;
degreesF = ( (9/5 * degreesC) + 32 ) ;
value = degreesF;
return value;
}



public boolean isLessThan(Temperature other)
{
double F = 0;
Temperature FarenH = new Temperature();
FarenH.getFarenH(F);
F = value;
return true;
}
//
//

}

16 years ago
Hi guys,

I was doing a compilation and the following msg appears :


The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError

Any ideas how I can solve this?
16 years ago
Hi,

Wrt the code :

public void C1()<<<----method name same as class name and return nothing
{
//some code
}


I thought the keyword void should not be included as it is a constructor.
Only different parameters are allowed.
16 years ago
I also recommend Textpad. Keywords, comments etc are highlighted for easy recognition.
16 years ago
Hi,
wonder if you could help to solve a syntax err?
the code is exactly downloaded from sun tutorial website.

Thnks


import java.util.*;

class Deal {
public static void main(String[] args) {
int numHands = Integer.parseInt(args[0]);
int cardsPerHand = Integer.parseInt(args[1]);

// Make a normal 52-card deck
String[] suit = new String[]
{"spades", "hearts", "diamonds", "clubs"};
String[] rank = new String[]
{"ace","2","3","4","5","6","7","8",
"9","10","jack","queen","king"};
List<String> deck = new ArrayList <String> ( );
for (int i = 0; i <suit.length; i++)
for (int j = 0; j <rank.length; j++)
deck.add(rank[j] + " of " + suit[i]);

Collections.shuffle(deck);

for (int i=0; i<numHands; i++)
System.out.println(dealHand(deck, cardsPerHand));
}
}



D:\JCL-Extraction\JCL-Interfaces\MOM - Interface\08A-ZLB366OM\Deal.java:14: '(' or '[' expected
List<String> deck = new ArrayList <String> ( );
^
1 error
16 years ago