7,116 Posted Topics

Member Avatar for gahhon

See http://docs.oracle.com/javase/tutorial/java/concepts/inheritance.html Alll the javadoc is [here](https://docs.oracle.com/javase/8/docs/api/index.html?overview-summary.html)

Member Avatar for stultuske
0
247
Member Avatar for lena1990

local app sends sound remote app plays it remote microphone hears sound being played remote app sends what it hears back to you you hear an echo

Member Avatar for lena1990
0
398
Member Avatar for andreas.petrou.967

Was there a question, or did you just want to share this code with us all?

Member Avatar for JamesCherrill
0
184
Member Avatar for Mazahir

Hello Mazahir. Exactly what help do you need? Nobody here will write the solution for you, but if there's some specific problem that is stopping you, we will help with that.

Member Avatar for overwraith
0
326
Member Avatar for shahera.arafat

You create a frame and a VectorDraw panel, but you don't add the panel to the frame!

Member Avatar for shahera.arafat
0
110
Member Avatar for lstew48
Member Avatar for JamesCherrill
-1
150
Member Avatar for entropicII

That code is mostly OK. If you use `i` to index into the arrays to add the words (lines 8,9) then you need to increment it after processing each line (like lineCount). Lines 2 and 3 create two variables that can refer to String arrays, but you haven't actually created …

Member Avatar for entropicII
0
222
Member Avatar for divinity02

At a far far simpler level I have a NetBeans project that looks a bit like class test { public static void main(String[] args) { // put code to test here } } so when some interesting bit of code appears on DaniWeb I can just paste it in there …

Member Avatar for JamesCherrill
0
117
Member Avatar for learningjav
Re: HELP

You just copy/pasted your assignment without even a moment taken to explain what help you need. That's highly disrepestectful to the many people who give their time to help others here. There are lots of people here who will freely give their time to help you become the best Java …

Member Avatar for learningjav
0
86
Member Avatar for Linh_1

Your post's title says "in Java", but the requirement is "in VB script". Either way, when you have worked out what language you are using, you will find many comprehensive tutorials on the web. There's no need for anyone here you write a new tutorial just for you.

Member Avatar for Aslam Mansoor
0
344
Member Avatar for andruluchko
Member Avatar for mKorbel
0
1K
Member Avatar for Taz098

I guess you've looked through [this topic](https://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners)?

Member Avatar for JamesCherrill
0
207
Member Avatar for Darth Vader
Member Avatar for Mubsahir Ijaz

OK, I've written it, and it does compute the average of these numbers and then tell for each number whether it is above, below or equal to the average. What now?

Member Avatar for misi
0
186
Member Avatar for samsungfanb0y

Either have an "Add" button, or wait until the user presses enter in the textfield to trigger adding the item to the queue

Member Avatar for JamesCherrill
0
79
Member Avatar for shahera.arafat

You have a single blank character at the start of the string. Ie it's " 2", but it should be "2". The blank character is not valid when parsing an integer. Maybe you are initialising out to " " instead of "" somewhere?

Member Avatar for shahera.arafat
0
254
Member Avatar for shahera.arafat

That's a nice refactoring,... for Java 7 ;) Now for current Java you can take it a lot further and simplfy the code massively. I'm referring to the event handler(s). Just pass the action handling code to createButton, and completely get rid of the hidious 120 line universal ActionListener private …

Member Avatar for shahera.arafat
0
301
Member Avatar for Doogledude123

Unless all your tiles are moving/changing all the time, maybe you can just re-paint those tiles that have changed since the last call to paintComponent - if you remove the super.paintComponent call then your Graphics will still contain its previous contents.

Member Avatar for mKorbel
0
1K
Member Avatar for idmanner

You have an infinite loop in a MAX_PRIORITY thread (line 215), so it's not surprising that nothing else gets done. What exactly are you trying to achieve?

Member Avatar for JamesCherrill
0
283
Member Avatar for Doogledude123

If you want two independent spinners then why are you worrying about giving each its own model?

Member Avatar for JamesCherrill
0
142
Member Avatar for Pobunjenik

What do you intend with `thisConnection` and `newConnection`? They don't seem to make a lot of sense. Anyway, you can only serialise a class that implements Serialisable (so check its API doc). Some classes (eg ones that are intrinsically tied to some operating system resource and use its state) are …

Member Avatar for Pobunjenik
0
391
Member Avatar for Fruits1234

... and line 40 you are comparing a phone number with a name - obviously a typo.

Member Avatar for JamesCherrill
0
184
Member Avatar for game123
Member Avatar for Roger_2

No, it's not the token that's null. What is the value of the reference variable `postfix` on line 23 in the code you posted?

Member Avatar for Roger_2
0
548
Member Avatar for sahar.97

How to pop from a queue that just supports enqueue/dequeue: Hint: You can extract any arbitrary member of a queue,eg nth member, by cycling the queue, ie dequeing and immediately re-enqueing n-1 members, then the next dequeue is the desired member. (If that wasn't the last member then you also …

Member Avatar for sahar.97
0
219
Member Avatar for Doogledude123

I question the need for your own special file format ("much faster" probably means you will save a few microSeconds), but anyway... You can use a DataOutputStream to write java primitives, byte arrays, and Strings to a binary file as a sequence of bytes in their normal internal binary format. …

Member Avatar for JamesCherrill
0
852
Member Avatar for DeanMSands3

Maybe just loop through the keys of one of the Maps, deleting all the entries that don't have a corresponding key in the second Map?

Member Avatar for DeanMSands3
0
2K
Member Avatar for Rohith_1

Is there any particular reason to do this in Java? Do you already have Java expertise? Maybe you could do it more easily in a scripting language.

Member Avatar for peter_budo
0
212
Member Avatar for Leonard_3

Hi Leonard, welcome to DaniWeb Sure, people here will happily help you. Now you need to be more specific about what questions you want answered. If you have errors you don't understand, post the *complete, unedited* error message and the excalt line of code it refers to. The better your …

Member Avatar for JamesCherrill
0
333
Member Avatar for sanketdomal

If you want people to share with you that's a two-way process. You should start by sharing what you have done. Or maybe you just want someone to do your project for you - in which case you have come to the wrong place.

Member Avatar for JamesCherrill
0
191
Member Avatar for ddanbe

It worries me that much of this discussion is about the difficulty or efficiency of inheriting either way. And although Liskov is 100% relevant, it's a heavyweight way of expressing the absolute basic English definition: "inheritance" is an *is-a* relationship If a Vector *is-a* Matrix then Vector is a subclass …

Member Avatar for mike_2000_17
0
363
Member Avatar for malihakhan8

Take 3 characters at a time (from the right hand end) and convert them to one octal digit. (You could use if tests, a switch, or index an array).

Member Avatar for JamesCherrill
0
55
Member Avatar for sabata mmoledi
Member Avatar for centenond

Maybe you could render all your graphics at some fixed resolution (eg HDTV) and use a `scale(double sx, double sy)` to scale all the contants to whatever the actual screen resolution is? As for speed... what Timer are you using?

Member Avatar for centenond
0
338
Member Avatar for sushma_1

Opening and closing multiple streams on a single Socket can cause data loss problems (buffers discarded etc). Opening multiple streams and not closing them is even worse. You could try creating the input & output streams just once, when you do the connect, then use those streams when sending.

Member Avatar for JamesCherrill
0
231
Member Avatar for ruhulaminice

Many many people run Java Database code in Eclipse, and it works very well. There are many tutorials on the web. If you would like help here you must explain exactly what you tried and what problems you had.

Member Avatar for Heanre
0
431
Member Avatar for errjolli1

You have no choice but to read the file from the start until you get to the line you want. (Unless the lines are all the same fixed length, in which case you can use a random access file and seek directly to the calculated offset of the desired line)

Member Avatar for anandhachandru
0
123
Member Avatar for Nandomo

Instead of just sending fixed length buffers, send a byte count followed by the buffer. For most packets the count will == the buffer size, but for the last packet the count will tell you how many bytes are data, so you can ignore the rest.

Member Avatar for JamesCherrill
0
122
Member Avatar for Doogledude123

Yup XMLEncode and XMLDecode will convert anything bean-like to XML dead easily. Also works for beans-within-beans, so you can encode/decode an entire List, or arbitrary top-level container object in just one method call. You could also create a zip file with all your files in it (java.util.zip.*)

Member Avatar for ~s.o.s~
0
327
Member Avatar for michael.james.90475

Wrap the code in a no-args method, eg public static void doMyStuff() { ... then new Thread(Client::doMyStuff).start(); Easy or what? ps: I don't like seeing all that in static methods, but that's another question. You will presumably need multiple instances of the class (different instance variable values) for your multiple …

Member Avatar for michael.james.90475
0
533
Member Avatar for Tigr@

Acceleration may be due to starting a new timer each time you click - n timers = n times as many events per second (?)

Member Avatar for JamesCherrill
0
159
Member Avatar for bongumusa
Member Avatar for Ant695

Some of the cases do have breaks, but that's not the real problem. (sorry Ant695 but you're going to kick yourself when you read this...) You should be switching on the chosen planet, not the person's weight! J

Member Avatar for JamesCherrill
0
187
Member Avatar for michael.james.90475

Because bytes are integer values. Doubles are 8 byte floating point values. When you assign a float value to a byte it's rounded down to the nearest integer value. You also have a problem if the value is >127, becuase that's the largest value a byte can hold. Either way, …

Member Avatar for JamesCherrill
0
233
Member Avatar for Doogledude123

The only thing that matters is that you load the tile once to create a Tile object that persists for the whole game. Provided you do that, `static` or `final` won't make any difference. Regardless of how you track those objects (in an array or a List etc) they still …

Member Avatar for JamesCherrill
0
178
Member Avatar for gahhon

They are two different Objects that happen to have the same values in them. They occupy different places in the JVM's heap, and have different hashes. The == operator will return false. You can change one of them, and the other will not be changed. All Java objects have an …

Member Avatar for gahhon
0
206
Member Avatar for shifiya

This looks like a pretty way of describing a Convex Hull to me. ps: I wonder why they specify the max number of records of data (20), but not the max number of points per record?

Member Avatar for iamthwee
-1
150
Member Avatar for jjones0150
Member Avatar for stultuske
0
312
Member Avatar for Praveen_10
Member Avatar for anandhachandru
Member Avatar for anandhachandru
0
626

The End.