2,443 Posted Topics

Member Avatar for Lostin
Member Avatar for masijade
0
95
Member Avatar for atinus cool
Member Avatar for zetologos

Yes. A good rule of thumb, I've found, is that public (and maybe protected) methods should use the interface (I.E. list) as parameter and return types. Whereas private (and maybe default) methods could easily use the implementation (I.E. ArrayList). This second part can make changes more widespread when a change …

Member Avatar for masijade
0
104
Member Avatar for Katana24

[QUOTE=seanbp]What about Python inspired iteration? [CODE]byte range[] = new byte[5]; for (byte nul : range) { System.out.println("do stuff"); }[/CODE][/QUOTE] Uhm, you [i]do[/i] realise that [i]that[/i] is [i]still[/i] a for loop, right? (In [i]your[/i] code anyway, what actually gets compiled is an Iterator with a while loop.)

Member Avatar for masijade
0
167
Member Avatar for kvkc

Why not "write the download" in Java? How is it being downloaded? If by FTP google for an FTP library (apache provides one), if by http, see the API docs for HttpURLConnection, if by SSH see [url=http://www.jcraft.com/jsch/]JSch[/url].

Member Avatar for masijade
0
1K
Member Avatar for sumeetdesaeee

The "connection object coming to it" is the one provided to it by whatever calls it. What calls it? Where did that get its connection? I assume you [i]do[/i] know what [i]your[/i] program does, right?

Member Avatar for sumeetdesaeee
0
610
Member Avatar for rpjanaka
Member Avatar for Jacob Majana
0
368
Member Avatar for gedas

With an object to "record" the coordinates of the line and then either drawing, or drawing over, the line on button click using an actionlistner and swingutilities.

Member Avatar for JamesCherrill
0
75
Member Avatar for RaySan
Member Avatar for AndrewSD

You won't find any "good tutorials on web crawlers". That is a bit of a broad subject. Find some tutorials on HTML parsers and HttpUrlConnection as well as some good general explanations of what a web crawler consists of and go from there.

Member Avatar for KirkPatrick
0
95
Member Avatar for prem2

No, that is [i]not[/i] "putting it on the classpath". Do not put [i]anything[/i] into the jre/jdk directories. If executing/compiling from the command line (without the -jar option) use the -cp option, if running from the command line with the -jar option, correctly configure the manifest file and place the jar …

Member Avatar for prem2
0
689
Member Avatar for varunsara

You will have to ask the designers of the language because it was their [i]conscious[/i] decision not to include. Most people assume it was to avoid the problems that C++ currently has with Diamond inheritance. P.S. Java [i]does[/i] have multiple inheritance of [i]Type[/i] (you can include as many interfaces as …

Member Avatar for GuruMS
0
81
Member Avatar for atinus cool

Open a text editor, type code, save, exit the editor, open a command shell, cd to where you saved the code (with a .java extension and the same name as the public class contained) use javac to compile, and java (or javaw) to execute.

Member Avatar for masijade
0
106
Member Avatar for elcliff

Because there [i]is[/i] no parseString method in String. Simply assign the provided String to the new variable. The API docs are your friend, BTW. Ask them [i]first[/i].

Member Avatar for masijade
0
761
Member Avatar for nitins60

Close the bufferedwriter and not the file writer. By closing the filewriter you are probably preventing the bufferedwriter from flushing.

Member Avatar for masijade
0
167
Member Avatar for whong09

Because toString() is called using Objects declaration, in that case, and polymorphism causes Date's toString() method to be used. You do know that imports have [i]no[/i] effect on a compiled class, right? They are not even there anymore. They exist solely in the source files and solely for programmer "convenience", …

Member Avatar for whong09
0
119
Member Avatar for eman 22

A "marker" interface is an interface with no methods and no variables and simply used to "mark" a Class. I don't think an example should be necessary.

Member Avatar for JamesCherrill
0
94
Member Avatar for Xeros606

Because [i]everything[/i] about Apple is proprietory and they [i]want[/i] it that way, and they want to [i]keep[/i] it that way.

Member Avatar for masijade
0
106
Member Avatar for Chillin2
Member Avatar for Sourabh Kosta

Okay? Nobody writes error free programs in a first draft (or even 100th, many times), so what's the problem?

Member Avatar for seanbp
0
158
Member Avatar for sneha Butala
Member Avatar for SailBlue5

See the API docs for SimpleDateFormat and attempt to define as many formats as possible and attempt to parse them with leniency off. [i]Not[/i] an easy task, but I don't know of any API that already does it.

Member Avatar for masijade
0
85
Member Avatar for Phil++

Because your array contains all null references. When you create an array of Object (regardless of the Object type) all it creates is an array of references, but, until you assign the reference to an actual object to those slots, the slots are filled with null references.

Member Avatar for masijade
0
89
Member Avatar for smoke1914

Okay, so lets see what you have. And, if by "help" you mean that we should write (any part of it) [i]for[/i] you, then you can forget that now.

Member Avatar for ProgrammerAl
0
87
Member Avatar for hauda67

Well, you want to actually set a value in index 24, right? So it is either <= 24 or < 25 (the same goes for the 49). You also want to set the value at that index so what is the length reference doing there? Also, the last half should …

Member Avatar for hauda67
0
166
Member Avatar for vallikasturi
Member Avatar for nitins60
Member Avatar for ~s.o.s~
0
144
Member Avatar for Swiftle

Okay, lets say your locks are numbered 1 - 5 (looking at your max min loop). Now, lets say two threads are working, one doing a forward sort and one doing a backword sort. Now, lets say the one doing the forward sort gets a lock on say lock three, …

Member Avatar for Swiftle
0
126
Member Avatar for vinit trivedi
Member Avatar for Ron2794

Please at least let people know that you are [url=http://www.java-forums.org/new-java/36105-get-my-conecpts-right-please.html]cross-posting[/url].

Member Avatar for masijade
0
160
Member Avatar for Ron2794

[url=http://download.oracle.com/javase/1.5.0/docs/guide/language/generics.html]Generics[/url]

Member Avatar for masijade
0
93
Member Avatar for Java_90

Well, if your starting it as an application (and not an applet or web service or etc) then yes (assuming the actual "m.End()" method creates and displays the GUI). If the JFrame is being created in the constructor (and "MyClass" extends JFrame) then you should change that. Make "MyClass" extend …

Member Avatar for quuba
0
94
Member Avatar for saifjunaid

Well, why don't you tell us [i]what[/i] your exact problem is and post a small, self-contained, compilable piece of code that demostrates the problem.

Member Avatar for masijade
0
75
Member Avatar for Ron2794

[i]What[/i] exception? The full stack trace please. And [i]don't[/i] do [code]catch(Exception e){ JOptionPane.showMessageDialog(null,"Error in connectivity"); }[/code] Show the [i]actual[/i] exception not some meaningless string. Edit: Or, at least, not [i]only[/i] the meaningless String.

Member Avatar for Ron2794
0
631
Member Avatar for sweety_sharma

Uhm, 1. You [i]do[/i] know that this thread is a 2+ year dead zombie, right? Why did you resurrect it? 2. You [i]do[/i] realise that the respone Phalax made was a sarcastic insult on the OPs typing skills, and not a serious suggestion, right? Closing this thread now.

Member Avatar for masijade
-2
182
Member Avatar for Sunshineserene
Member Avatar for iammet
Member Avatar for hatux

See the API docs for the Comparator Interface (and google a tutorial or two) and then use the Collections.sort(List<T>, Comparator<T>) method.

Member Avatar for masijade
0
107
Member Avatar for reyarita

Sure we can. Post your code and a specific question and we'll be happy to help [i]you[/i] correct/improve/complete [i]your[/i] code.

Member Avatar for reyarita
0
92
Member Avatar for sivaprakashm

Nope. static methods are [i]class[/i] specific. I.E. They apply to that class and that class only. If a subclass then declares a static method of the same name and parameters as its super class it then "hides" the method from the super class (when accessed through the subclass), but does …

Member Avatar for masijade
0
139
Member Avatar for rayden150
Member Avatar for masijade
0
89
Member Avatar for spades0001

Stick to original [url=http://www.daniweb.com/forums/thread329067.html]thread[/url]. Closing this thread now.

Member Avatar for masijade
-1
118
Member Avatar for Awesomeness
Member Avatar for dreamslct

Well, lets see your code, but, to tell you the truth it is nothing but a small, simple GUI, a FileReader and String's split method.

Member Avatar for masijade
0
496
Member Avatar for spades0001

[QUOTE=spades0001]I'm trying to make it color red. I've been trying to change the color for 2 days[/QUOTE] Where? Nothing in that code attempts to change the color of [i]anything[/i].

Member Avatar for masijade
0
300
Member Avatar for Kiseki
Member Avatar for Kiseki
0
154
Member Avatar for sijothomas

[Code=Java]FOR CONVERTING COLOR IMAGE TO GREYSCALE IMAGE and creating the histogram of that greyscaled image .Including header files also...[/Code]

Member Avatar for masijade
-2
91
Member Avatar for fenomenal

And your question? One note though, I would use "names.length" rather than "18" in your random number generation. I would also make "r" an instance variable rather than creating a new one with every call to "getPartner".

Member Avatar for masijade
0
101
Member Avatar for Doshag

[url=http://download.oracle.com/javase/1.5.0/docs/guide/language/varargs.html]Varargs[/url]

Member Avatar for Doshag
0
177
Member Avatar for aramesh1989

Hopefully not a [i]real[/i] project. If so send me the site name that I know never to use it. If this is a school assignment, then, before becoming this "project" you would have been taught the things you [i]need[/i] to know, and would be expected to research and be creative …

Member Avatar for masijade
0
120

The End.