Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
Ranked #2K
~3K People Reached
This member's community profile is only visible to logged in members until they have earned 15 reputation points.
Favorite Forums

13 Posted Topics

Member Avatar for NewOrder

[CODE] if(animals[i] instanceof Cat) ((Cat)animals[i]).makeNoise();[/CODE] The if statement here is saying if the Object contained in the Object array animal, at index i, is a Cat object then execute [icode]((Cat)animals[i]).makeNoise();[/icode] Because animals is an array of Object, if you try this [icode]animals[i].makeNoise();[/icode], you will get an error, because animals[i] will …

Member Avatar for NewOrder
0
132
Member Avatar for glenak

It's not too hard to do a basic version of this. All it involves is creating a Thread for each client that connects to the server. So if client A is being processed with thread A, and client B with thread B, any messages thread A sends will go to …

Member Avatar for glenak
0
253
Member Avatar for developer@india

James is right, this is taken from Suns Java tutorials on Primitive Data Types: [QUOTE]boolean: The boolean data type has only two possible values: true and false. Use this data type for simple flags that track true/false conditions. [B][I]This data type represents one bit of information, but its "size" isn't …

Member Avatar for ~s.o.s~
0
233
Member Avatar for hmarie88

Theres a LOT of code there.. But I think your problem is as follows: In the Product class you've defined the constructors as follows: [code=java] public Product(String Model, double restockFee, String Name, String stockNumber, int Units, double Price) and public Product(String Model, String Name, String stockNumber, int Units, double Price) …

Member Avatar for hmarie88
0
123
Member Avatar for JamesCherrill

Haven't used generics in a while, but is something like this what your looking for: [code=java] import java.util.ArrayList; public class GenericTest<T> { private Class<? extends T> instance; public GenericTest( Class<? extends T> instance ) { this.instance = instance; } public <T> void addNewTo(ArrayList<T> list) throws InstantiationException, IllegalAccessException { list.add( (T) …

Member Avatar for JamesCherrill
0
204
Member Avatar for chaos123456

You are trying to turn something into an Integer that cannot be turned into an Integer. You are trying to turn "A,Jan-02-2007,11,table,10.56,1" into an Integer, which you can't do.. That is why you are getting a [icode]NumberFormatException.[/icode] What exactly do you want to turn into an Integer..?

Member Avatar for chaos123456
0
645
Member Avatar for pateldeep454

Always remember, the Java API is your greatest weapon! :) [url]http://java.sun.com/j2se/1.5.0/docs/api/java/math/BigInteger.html[/url]

Member Avatar for pateldeep454
0
156
Member Avatar for jiraiya

If your program uses the command line, then I believe it will be the shell/consoles job to catch the enter or any other key press and not the actual java program. There may be a way to do it from the console ( probably using java.lang.Runtime ), but it can …

Member Avatar for jiraiya
0
155
Member Avatar for BuhRock

Instead of using Character.isDigit( char ), you could use the matches() method from the String class. This would save having to test the length of the data and having to convert it to a char. [code] import javax.swing.JOptionPane; public class Test { public static void main(String[] args) { String input; …

Member Avatar for chaospie
0
147
Member Avatar for mahdi68

You can do this by reading the file /proc/version. I contains the kernel version, distro name/version and more information. It should exist in all distributions. I actually only found this out today! :) EDIT: It seems like I was wrong, only some of the major distributions add the actual distro …

Member Avatar for chaospie
0
104
Member Avatar for pateldeep454

You should look up the modulus operator ( which in java is % ) to solve this problem..

Member Avatar for pateldeep454
0
909
Member Avatar for kesh1000

For a sorting algorithm ( or any class for that matter ) that can work for ANY type, user defined or not, you are going to have to know a bit about Generics in java. Also, for a sorting algorithm those types must be comparable. If you do not know …

Member Avatar for chaospie
0
244
Member Avatar for bufospro

DataOutputStream will write the int as bytes to the file, that is why strange symbols are appearing. If you want the int to be displayed as is, you should use an Object like a PrintWriter instead.

Member Avatar for bufospro
1
130

The End.