7,116 Posted Topics

Member Avatar for Varunkrishna

Here's Oracles brief operating instructions for jconsole https://docs.oracle.com/javase/tutorial/jmx/overview/javavm.html ... but what do you really want/need to know? I can't imagine that a memory address is going to be useful to you.

Member Avatar for Varunkrishna
0
286
Member Avatar for NewOrder

... and it's not great code - obviously written by someone with limited Java skills, so it's not a good example to follow. (Even less a good piece of code to copy and claim as your own.)

Member Avatar for JamesCherrill
0
3K
Member Avatar for laguardian

Looking at your SQL statement (line 37) it lookslike you have a comma right at the end - just before the closing ) Maybe that's the syntax error?

Member Avatar for jwenting
0
2K
Member Avatar for Sloane_1

JTextArea has an `append(String s)` method that you call to add text to the end of whatever is currently being displayed in the text area (which starts out empty). So before your loop, create a text area and add it to a JFrame that's visible on the screen. Use a …

Member Avatar for JamesCherrill
0
1K
Member Avatar for scheppy

What level of phone - just a voice'n'texts basic model, or an internet-connected smartphone?

Member Avatar for JamesCherrill
0
116
Member Avatar for LibraryCode

Remember that a switch case will drop through into the following case unless it has a break; So you are on the right tracks there except that you don't need lines 27, 28 or 33. If you enter case 3 then it will print 3 french hens then drop through …

Member Avatar for JamesCherrill
0
249
Member Avatar for jamesjohnson25

After a very quick look at that code I see 5 threads: The main thread obj1 obj1.t obj2 obj2.t of which main, obj1.t and ob2.t are started but you try to join obj1 and obj2, which have not been started

Member Avatar for JamesCherrill
0
825
Member Avatar for jamesjohnson25

Although your individual Bank methods are synchronised, this only means that calls to each of those methods *for the same Bank object* will not overlap. It looks like you want each execution of BankInstance's run method to complete before the next one starts. If so, you need to synchronise the …

Member Avatar for JamesCherrill
0
224
Member Avatar for Lgie

Without seeing the exact code that generates that error messgae it's imposiible to say. But in general, if you have an array of objects you definitely can access their public getter methods to retrieve the values of their instance variables.

Member Avatar for JamesCherrill
0
283
Member Avatar for Suzie999

Sorry Rubberman. Despite your impressive experience the first hex number is NOT separated from the rest by dual colons . Suzy's last post is correct. See RFC5952 https://tools.ietf.org/html/rfc5952#section-2.2 One (and only one) sequence of zero fields can be replaced by a:: It's also recommended that :: is not used for …

Member Avatar for JamesCherrill
0
4K
Member Avatar for ArunSP

Sorry necrovore, that would add an asterisk to every line. Between lines 19 and 20 would be better. The problem is that on the last line the loop lines 6-9 is not executed, so the variable `a` does not get set, so it keeps its previous value of 1, which …

Member Avatar for ArunSP
0
209
Member Avatar for Jeanyl_1
Member Avatar for nabia1

Please post the exact complete error message - copy/paste it, don't just give us your summarised version

Member Avatar for JamesCherrill
0
329
Member Avatar for scheppy

There's a complete example in the introductory description in the standard API documentation

Member Avatar for JamesCherrill
0
300
Member Avatar for sirlink99

You don't multiply the color values together! You multiply the color values by the corresponding values in the 3x3 matrix, then divide by the sum of the matrix. With a matrix of all 1's that's particularly trivial - you are multiplying the values by 1 (!), adding the results, and …

Member Avatar for JamesCherrill
0
564
Member Avatar for Cory_1

You split each line into words (line 19) but then you do nothing with that, you just add the complete line to your ArrayList. But anyway, the only way I can see for you to get gibberish output like that is if your default charset doesn't match the actual file's …

Member Avatar for JamesCherrill
0
2K
Member Avatar for AbstractEden

The result could be as long as the longer input aray, or 1 digit longer than that (if you end up witha carry), so maybe the easiest way is to set up 3 arrays of length (longest input +1), read the inputs into two of them and calc the result …

Member Avatar for AbstractEden
0
281
Member Avatar for sciprog22

"ascending" is defined by the compareTo method. a,b is ascending iff `a.compareTo(b) >0` If you reverse the test inside the compareTo so that `a.compareTo(b) <0` then you have just definied a,b as a descending sequence.

Member Avatar for sciprog22
0
166
Member Avatar for Swathi_3
Member Avatar for jwenting
0
187
Member Avatar for Cory_1

24: compareTo returns an int -1, 0, or +1, but not a boolean 31/32: you can't have method calls like that on the LHS of an assignment. You probably want to use `set` to change the contents of the list

Member Avatar for JamesCherrill
0
4K
Member Avatar for Saddamkhan

1. Decide which platform you are going to major in. It's not hard to learn a new language; algorithms and techniques are mostly portable; but to be good at games you need to understand the actual API/graphics tools in all their horrible detail with all their horrible quirks and work-arounds. …

Member Avatar for jwenting
-2
225
Member Avatar for venkyb

So, you have published you teacher's original (copyrighted?) assignment here. And what did you expect to achieve by that?

Member Avatar for JamesCherrill
-1
208
Member Avatar for Sara_13

or you could simply use a loop (in pseudo-code): int posCount=0, negCount=0 while (more input to process) input next number if (next number > 0) posCOunt++ else negCount++ print counts

Member Avatar for David W
0
288
Member Avatar for Donald_5

That logic looks suspicious! Maybe something like this (in pseudocode) would work better for each row in the result set { use the noRoom to find the corresponding button if status is "filled" set button red else set button green }

Member Avatar for JamesCherrill
0
196
Member Avatar for jamesjohnson25

Start by reading the instructions... "store the values in Card object with the attributes symbol and number." ... but also, when you need to add a new key/value pair you use the unhelpfully-named `array` for the value. You keep adding numbers to that, so (1) it keeps getting bigger and …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Jeanyl_1

The "unknown source" is just referring to the internals of the Java API classes (for which the source code is not on your computer). The first lines of the message tell you what you need to know... ArrayIndexOutOfBoundsException: 0 at myGUI.Summary.actionPerformed(Summary.java:67) that looks like line 111 in the code as …

Member Avatar for JamesCherrill
0
403
Member Avatar for sciprog22

Your understanding is wrong in that the key/value pair is not replaced, just the value. The API doc says "If the map previously contained a mapping for the key, the old value is replaced." Your `equals` method defines two Accounts as being the same if the name fields are equal, …

Member Avatar for sciprog22
0
224
Member Avatar for yadhu

static = one value, shared for all instances of the class non-static = every instance has its own values

Member Avatar for jwenting
0
73
Member Avatar for COKEDUDE

That cast converts a char numeric value to an int by padding it arithmetically. What you seem to want is to parse a character value in the range '0' - '9' to the numeric value it represents. Remember the char '0' is a numeric value of decimal 48 in ASCII

Member Avatar for JamesCherrill
0
1K
Member Avatar for hazelkahn

hazelkahn So we don't delete all your posts as junk, can you please explain what you are trying to do. Do you want solutions to these exercises? Are you proposing them as good exercises for learners to try? Something else?

Member Avatar for JamesCherrill
-2
156
Member Avatar for changadeya

Yes, some people here do have such source code. If you give us your teacher's email them we could email it directly to him/her and save you the effort of pretending that you wrote it. Alternatively, you could read the DaniWeb Rules that you agreed to when you signed up, …

Member Avatar for JamesCherrill
0
98
Member Avatar for abdullah_8

Same problem as in your previous post: "sum" is not a Java type, nor a class. Line 8 also has invalid syntax for calling a method

Member Avatar for JamesCherrill
0
213
Member Avatar for abdullah_8
Member Avatar for Anthony_8

You have to use the `Console` class and its `readPassword` methods. In that case it's probably easier to drop the BufferedReader and just use Console's `readLine`. Docs are in the usual place.

Member Avatar for JamesCherrill
0
433
Member Avatar for minteks

A couple of hints to get you started: You changed the signature of the method by adding a parameter. That's not what is required. You declared a variable for the track name. A name is usually a String, not a Track object

Member Avatar for Taywin
0
262
Member Avatar for erikasibulo
Re: hi

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 JamesCherrill
-2
194
Member Avatar for Cory_1

The > operator only works for numeric primitives. Depending on the type of the generic arguent that could mean Circle1 > Circle2 (etc) Because all your generics implement Comparable. you must call `compareTo` rather than using numeric operators

Member Avatar for JamesCherrill
0
6K
Member Avatar for hwoarang69

You didn't say what your question was, but... decide whether you are using i,j or row,col - don't mix them Don't forget to print the answers

Member Avatar for JamesCherrill
0
753
Member Avatar for Toby14

( 9 / 5 ) 9 and 5 are both ints, so the division is done in integer arithmetic, giving the result 1

Member Avatar for Toby14
0
143
Member Avatar for Vinolia

Sorting the array is massive overkill for just finding the largest entry, and permanently changes the array, which may also be undesirable. stultuske's "try this logic instead" approach is by far the best.

Member Avatar for JamesCherrill
0
251
Member Avatar for Ahmed_62

"someone give me a code" ? ! This is not a site for the lazy, the cheat, or the selfish entitled. This is a site for people who want to work and to learn. You may want to think again about what you just posted.

Member Avatar for JamesCherrill
-1
104
Member Avatar for Tanner_1

Even better, do that and also make sure your names accurately reflect their use. If I see a method `void setColor(String colors)` then I would expect to be able to pass more than one color in the String parameter. Far better to do it properly: public void setColor(String color){ this.color …

Member Avatar for JamesCherrill
0
261
Member Avatar for sirlink99

Maybe: You have video code like loop do CPU intensive stuff wait 20 mSec that's only going to loop 50 times per second if the CPU stuff is instantaneous (which stuff like yours will definitely not be) At the very least you need something more like loop endTime = time …

Member Avatar for sirlink99
0
1K
Member Avatar for hwoarang69

After you read the first int, the next call will read the second number int num1 = f.nextInt(); // reads 1nd num int num2 = f.nextInt(); // reads 2nd num similarly in the loop you can call nextInt twice to get the two numbers and put them into the 2D …

Member Avatar for Stefce
0
220
Member Avatar for divinity02

? That reads the wrong way round... If you do not set a seed then the Random() constructor picks one - eg current time in mSec - so two runs will provide different sequences. If you set a seed and it's the the same, then you will get the same …

Member Avatar for divinity02
0
423
Member Avatar for newcoder310

Before people write too much code... What is the purpose of this class? Does it just hold some standard colors for yor app, and/or do you want to be able to retrive those colors by a name which is a variable at run time? Colors are immutable, so you don't …

Member Avatar for newcoder310
0
230
Member Avatar for divinity02

Oh dear, divinity02 139 posts and you don't yet know that you must: 1 start a new thread for a new question and 2 show what you have done

Member Avatar for newcoder310
0
273
Member Avatar for Brandon Hatch

The "standard" answer is to have a "model" class that contains the input data and performs the calculation. You create an instance of the and pass it as a parameter to the constructor of all your GUI classes. Now ny GUI class can use the its input fields to set …

Member Avatar for Brandon Hatch
0
233
Member Avatar for Mysquldata

Hint: Some of the classes you can use without an import include String and System. What package are they in?

Member Avatar for jwenting
0
116
Member Avatar for Curious Gorge

It's obviously designed with the assumption that it will only encode/decode A-Z, so it's not surprising that it fails with a blank in the input. Having said that... args[0] is maybe just the first word of your input, the other words being in args[1] etc, depending on how you typed …

Member Avatar for Curious Gorge
0
240

The End.