Posts
 
Reputation
Joined
Last Seen
Ranked #4K
Strength to Increase Rep
+0
Strength to Decrease Rep
-0
100% Quality Score
Upvotes Received
7
Posts with Upvotes
6
Upvoting Members
4
Downvotes Received
0
Posts with Downvotes
0
Downvoting Members
0
1 Commented Post
0 Endorsements
Ranked #818
~15.1K People Reached
Favorite Tags

52 Posted Topics

Member Avatar for ubi_ct83

The first clue is the type of Array you are using. You should be using an implementation of java.sql.Array, not java.util.ArrayList. Check the javadocs on its use, and you will probably get a little further.

Member Avatar for JamesCherrill
0
664
Member Avatar for DaniwebOS

Your program also doesn't compile. The BufferedWriter doesn't have a method named "writer". In your "for" loop, you call that non-existent method. Probably a typo? Anyway, pay attention to your compiler output - it should have given you an error message about it.

Member Avatar for NormR1
0
457
Member Avatar for swink11123

Well, as @stultuske said, read each line in your while loop. You'll need a variable, declared outside the loop, to hold the data you read. Probably a List of some type, though you could use an array []. When you read the line as a String object, you'll need to …

Member Avatar for jwenting
0
213
Member Avatar for javausers

So, you want to do something like: [CODE]Map<String, Object[]> objectMap = new TreeMap<String, Object[]>(); Object[] values = new String[] {"A", "B", "C"}; objectMap.put("First3Letters", values); [/CODE] Is that right? Yes, you can do that.

Member Avatar for javausers
0
139
Member Avatar for getmet

A very simplistic way to do it is to have 2 arrays; one to hold the quotes, the second of the same size to indicate whether a quote has been used or not. So, you might initially fill the second array, which indicates whether a quote has been used, with …

Member Avatar for JamesCherrill
0
92
Member Avatar for ravsau

Accessors and mutators are methods that retrieve or change the value of a class's instance variables. The naming convention is set<VariableName> or get<VariableName>. Thus, if I had a class with with an instance variable [code]private String cat[/code] , I would create an accessor [code] public String getCat() {...}[/code] and a …

Member Avatar for dononelson
0
878
Member Avatar for becool007

By "runs on a library" I'm assuming you mean it will be an executable jar file. But I don't know what you mean by classifying your program as a script. Are you planning on writing a program to read some text files that serve as scripts in some particular syntax? …

Member Avatar for NormR1
0
110
Member Avatar for jackmaverick1

Well, you probably don't really want to load the *jar* itself, you want to load one or more classes that happen to reside in the jar. In that case, you need to have that jar on your java classpath so that the JVM can find that/those classes in the jar …

Member Avatar for jackmaverick1
0
223
Member Avatar for bhallarahul

And you'll probably need to use JNI (Java Native Interface) to do it. You can check out the Java 6 guide here: [url]http://download.oracle.com/javase/6/docs/technotes/guides/jni/[/url]

Member Avatar for bhallarahul
0
76
Member Avatar for initialise

It's probably because you have the mysql.jar configured in your classpath for Eclipse (that's part of the process when you set up a datasource in the Eclipse database explorer, for example), but it's not in the classpath in your windows environment. You can set the CLASSPATH env variable to include …

Member Avatar for initialise
0
646
Member Avatar for newbie14

is the data in the database corrupted as well? If not, perhaps your file writer is not being flushed, over-running a buffer, etc. What do the log files say, if anything? Are there any IOExceptions being thrown?

Member Avatar for newbie14
0
119
Member Avatar for liphoso

If you use stultuske's approach, I would tend to use a StringBuffer or StringBuilder instead of creating a new string every time through the loop. I know this is a small example, and memory/garbage collection isn't really a priority for you right now. I only bring this up because if …

Member Avatar for dononelson
0
128
Member Avatar for aanders5

You may also want to look in to open source HTML parsers such as Jelly and Jericho. I can't recommend one over the other, but they have some very useful features that may help you.

Member Avatar for dononelson
0
196
Member Avatar for softswing

There are several JVM options that will increase the heap and stack size of the vm. Besides finding out what is eating all the memory, as James pointed out, you can look at garbage collection stats (java -verbose:gc, which will show, at least, how often the GC is running. You …

Member Avatar for JamesCherrill
0
246
Member Avatar for Sadun89

Personally, I would start with Java SE - it will give you the basis for other java editions, such as SE and EE. Once you learn to write simple effective java, you can move on to more complex concepts.

Member Avatar for Sadun89
0
132
Member Avatar for tracydo
Member Avatar for charchar88

You may also want to turn verbose garbage collection on and see how much time the program is spending collecting garbage. If it's a lot, it could indicate that your java heap is too low. (It's adjustable, just google java garbage collection and heap size adjustment). If you are using …

Member Avatar for nezachem
0
218
Member Avatar for Chitru

In my opinion, you don't need to learn awt first. The basic concepts are the same with both, but with different components and they way they interact. The most important things to learn are how to build up components (adding a label and a button to a JPanel, and adding …

Member Avatar for JamesCherrill
0
314
Member Avatar for kayba

Lots of good resources on the net - here's one: [url]http://www.coreservlets.com/JSF-Tutorial/jsf2/[/url] Also covers JSF 1

Member Avatar for dononelson
0
87
Member Avatar for Mestika

Just as a matter of convenience, there is a LineNumberReader available that will keep track of what line you are on - not sure if you need it, you may be just keeping your own counter, but I thought I'd bring it up.

Member Avatar for JamesCherrill
0
453
Member Avatar for scarletfire

Not knowing anything else about the code, could it be a capitalization problem between p.getName() and playerName? Try [CODE]if(p.getName().equalsIgnoreCase(playerName))[/CODE] and see if that helps.

Member Avatar for scarletfire
0
159
Member Avatar for SMITA6076

It's a best practice to make all instance variables private (or protected at least). In this way, you are enforcing the concept of encapsulation. The only time I use public instance variables public is when they are constants, such as [CODE]public static final String ACCEPTABLE_PUBLIC = "Acceptable public variable";[/CODE] Others …

Member Avatar for VernonDozier
0
331
Member Avatar for kesh1000

Not being able to see all of your code, my first guess is that jFileSave has not been instantiated. Also, what is your CustomFileFilter extending? Are you sure you have initialized it correctly? Without a stack trace, it's hard for me to guess where the problem might lie.

Member Avatar for kesh1000
0
184
Member Avatar for tracydo

Also, I would condense your large collection of variables into a separate class, and make some of your variable names more descriptive. "int h=0; //number of student name in the file" is completely unintuitive. In terms of the formatting of the output, you can use the String.format() method to get …

Member Avatar for dononelson
0
500
Member Avatar for ndiiie

Use split("//s") on your String object to form an array of words from the input. Then, reassemble the string, using your replacement word for the first element of the returned array, and the rest of the words in order from the array. A best practice is to use a StringBuffer …

Member Avatar for dononelson
0
182
Member Avatar for jackmaverick1

You can use the java.io.LineNumberReader, which can take a FileReader object in the constructor. The readLine() method on LineNumberReader will return one line from the file as a String. Why not use an ArrayList<String> to store the lines read? That way you don't have to know ahead of time how …

Member Avatar for masijade
0
117
Member Avatar for debeloglava

This is a complex problem that you will need to split into simpler parts with attainable tasks. Are you successfully send a message to the server and receive a response? Think about what your messages will look like when they are sent to the server, and received by the client …

Member Avatar for JamesCherrill
0
204
Member Avatar for 24x24

Yeah, it's a bit long, and there are other ways to solve what you are achieving, but overall, not a bad job! As far as not having learned what an object is, you're already using them. Your class is an object. String is an object. Math.random() is a (static) method …

Member Avatar for 24x24
1
182
Member Avatar for spidey32

The simple answer to your threading question is that since no variables are declared as part of the object, but are local to the method, only the thread executing the method has access to them. For a more thorough explanation research the JVM and stack frames. No one here will …

Member Avatar for spidey32
0
105
Member Avatar for Limiter

As of JDK 1.6, Scanner does not implement the Serializable interface. Here is the declaration from the code: [CODE]public final class Scanner implements Iterator<String> { [/CODE] Unfortunately, it being final means that you can't subclass it either. The only way to get around this problem, aside from writing your own …

Member Avatar for dononelson
0
337
Member Avatar for TSprog

Here are few initial thoughts. Approach this in small steps. The first step is to make a list of the things you actually need to do. For example, how do you get the text from the forums? This is the first problem I would tackle. There are a number of …

Member Avatar for TSprog
0
131
Member Avatar for newcoder310
Re: Time

You can start by checking out the java.util.GregorianCalendar class. You'll need to study it a bit to understand how it operates with its own fields such as HOUR, MINUTE, SECOND, MILLISECOND, the compareTo() method. If the times are presented as strings, then you'll also need to look at String.split() to …

Member Avatar for ~s.o.s~
0
106
Member Avatar for mkab

My first thought is to use an implementation of the Map interface, such as Hashtable or HashMap to store your data. The key to the map would be a String for the particular trait such as eye color, and the value would be the corresponding chromosome. Give this a try …

Member Avatar for dononelson
0
163
Member Avatar for soniajothi

Sorry, I won't do your homework for you. The instructions seem pretty straightforward - where are you stuck?

Member Avatar for dononelson
0
427
Member Avatar for lovelyRose

What exactly is the problem you are having? Please give us at least a hint as to what is wrong, and please enclose your code in code brackets, using the "{code]" button.

Member Avatar for dononelson
-1
168
Member Avatar for Limiter

If I understand correctly, you simply need to create getters and setters for each of your value objects (Book, BookShelf). You can certainly create a constructor that takes an array of Book objects: [CODE]public class BookShelf(String[] books) { ... }[/CODE] You would be much better off using an ArrayList instead …

Member Avatar for Limiter
0
2K
Member Avatar for desert564

Are you using an IDE with a debugger? If not, download Eclipse or Netbeans and walk through step by step and find your errors.

Member Avatar for dononelson
0
109
Member Avatar for dononelson

Newbie here, hoping to contribute some of my experience, and pick up new knowledge as well. Thanks Daniweb team for this site! Don Nelson

Member Avatar for e-papa
0
105
Member Avatar for SMITA6076

Your encounter can occur outside of the CyberPet class, using a collaboration pattern. Basically, create another class that has some method which accepts a list of CyberPet objects, compares them, and prints out (or returns) the result.

Member Avatar for SMITA6076
0
598
Member Avatar for 47pirates

Check out [url]http://jackcess.sourceforge.net/[/url] - that should get you on your way.

Member Avatar for mKorbel
0
249
Member Avatar for gcclinux

First, instead of putting all of your work in the main method, move the logic to it's own public method. Then, instead of printing out the results, make this method return a List<String>. Create a second class that calls that method, retrieving the list, and writing the contents to a …

Member Avatar for dononelson
0
156
Member Avatar for SMITA6076

Ok, the first thing I see is that you're trying to make a static reference to a non-static method in EmployeePayRoll - that's not allowed. You wouldn't want to do this anyway, since the value would never be saved. In your test class, instantiate an object of type EmployeePayRoll, e.g., …

Member Avatar for SMITA6076
0
301
Member Avatar for MisterSinyster

First, your constructor is expecting 4 ints and a double, but you're passing 3 ints, a double and an int to the Delivery class, in your CreateDelivery class. Also, the Delivery class has no such method as "displayFees()", and the variable "deliveryNumber" on line 62 of CreateDelivery is not defined …

Member Avatar for dononelson
0
113
Member Avatar for MoreHelp09

This makes no sense to me. What are you attempting to do in your switch statement? What is an example of the final output supposed to look like? I suggest you break down the problem (on paper) into simple steps and start over. Use separate methods to address each area …

Member Avatar for dononelson
0
1K
Member Avatar for Aepexx

Just jumping in here, but your Asn07Employees class needs a constructor that will accept the arrays it needs to manipulate. You might also consider using three ArrayList classes to which to add the values of the arrays. Then it's simply a matter of setting up some loops to fill the …

Member Avatar for dononelson
0
138
Member Avatar for iShrne

It would be good to see the code that you have, but as a guess, it sounds like you are supposed to iterate through your doubly-linked list and add each element to a java.util.LinkedList. Could it be that simple, or am I assuming too much?

Member Avatar for JamesCherrill
0
152
Member Avatar for bhallarahul

Please put your code snippets within [code][/code] blocks in the future - it makes it easier for us all to read. Can you post your exception stack so we can see what might be going wrong?

Member Avatar for Ezzaral
0
311
Member Avatar for mohit girdhar

Here are some points to think about before you open your java editor: 1. What is the simplest thing you can do to make it work? 2. How many people do you want to chat with at one time? 3. How do you identify the person/people participating in the chat? …

Member Avatar for dononelson
-1
127
Member Avatar for jimJohnson

The Java certification tests will certainly test your knowledge, and they look pretty on your resume, but I don't have any empirical evidence that they'll get you a job. The tests aren't cheap, but it might be worth taking the java programmer test. At the very least, go to the …

Member Avatar for dononelson
0
96
Member Avatar for sariberri

This works for me: public static void main(String[] args) { long time = System.currentTimeMillis(); try { Thread.sleep(3740); } catch (InterruptedException e) { } long time2 = System.currentTimeMillis(); NumberFormat nf = NumberFormat.getInstance(); DecimalFormat df = null; if(nf instanceof DecimalFormat) { df = (DecimalFormat) nf; double seconds = (time2 - time)/1000d; df.applyPattern("#.#"); …

Member Avatar for sariberri
0
218

The End.