7,116 Posted Topics

Member Avatar for Yahson

If you want people to spend time then you must a) explain exactly what help you need b) show what you have done so far ps I tagged this "Java" for you so the right people will see it.

Member Avatar for JamesCherrill
0
45
Member Avatar for nitin1

What you pass is the object that you are using as a lock. Only one thread can have the lock at any given time. (Every object has an associated monitor and wait and notify methods; these are the fundamental pieces with which thread synchronisation is implemented.) "this" is the current …

Member Avatar for JamesCherrill
0
276
Member Avatar for nitin1

In my opinion you can't beat the original Oracle tutorials http://docs.oracle.com/javase/tutorial/reallybigindex.html

Member Avatar for nitin1
1
297
Member Avatar for screenedcreamy

I'm no REGEX expert, but standard Java does include classes for parsing XML (and therefore HTML) without any "external libraries". That's probabaly the safest way to ensure your parsing isn't going to fail on some obscure but legal example of real data. http://docs.oracle.com/javase/tutorial/jaxp/index.html

Member Avatar for JamesCherrill
0
236
Member Avatar for Roger_2

`matrix` is a 2D array (strictly: an array of arrays) so you need two indexes to get to a single element in `matrix`. I don't know excatly what you tried, but you will need something like `if (matrix[i][j]) ...` where i and j are integers, integer expressions, or anything else …

Member Avatar for JamesCherrill
0
274
Member Avatar for mariam_3

use `removeAll` to remove all the elements in b from(a copy of) a... what ever is left is the answer

Member Avatar for JamesCherrill
0
241
Member Avatar for vilastadoori

After a quick look at that code I see three HashMaps. Only one seems to get anything put in it, and only one (not the same) gets printed. Makes no sense to me.

Member Avatar for vilastadoori
0
2K
Member Avatar for engrjd91

The Java equivalent of a memory leak is when you accidentally keep a reference to an object that prevents it being garbage collected. You would need to apply some incredibly sophisticated analysis to the entire program to have any chance of finding such an error statically. For that reason people …

Member Avatar for JamesCherrill
0
170
Member Avatar for Mar. Na.

You will have to use a loop that takes every word from the first string, and checks to see if that word is in the second string. The check is trivial, but without any spaces you are going to have fun trying to decide what is a "word" in the …

Member Avatar for Mar. Na.
0
290
Member Avatar for abogeorgeee
Member Avatar for pauline.zorilla

OK, I've done that. Please let me have your teacher's contact details so I can email it directly to him, thus saving you the bother of copy/pasting the solution. You will, of course. fail the course, and maybe get chucked out, but that would be quite reasonable given your attitude. …

Member Avatar for AssertNull
-2
132
Member Avatar for Muhammad Arslan_1

OK, I've written it. If you let me have your teacher's email address I can submit it for you to save you the bother of copy/pasting it yourself. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if …

Member Avatar for mabdullah4
0
196
Member Avatar for panduranga_1

That just confirms that you need a multi-pronged test strategy involving users, UI testers, DBAs etc. If your architecture is layered well then backend bugs should have been found during unit testing and subsystem testing. Maybe you are leaving too much testing until too late in the process?

Member Avatar for RudyM
0
278
Member Avatar for Rashmi_1

What exactly is theproblem... what is happening that shouldn't or what is not happening that should?

Member Avatar for JamesCherrill
0
275
Member Avatar for Riya@23

No, it's not any kind of Java language assumption. `println` is a method in the `PrintStream` class. (System.out is an instance of PrintStream). It's overloaded for all kinds of parameters, one of which is `char[]`, and that version prints the array as a single String. So the behaviour is an …

Member Avatar for JamesCherrill
0
1K
Member Avatar for Roger_2

> I also thought of using an array/stack/queue but filling it is O(N) and then running through that again is another O(N) creating an O(N^2) scenario again ? If there are two steps and each is O(n) then the whole thing is also O(n) - ie when you double n …

Member Avatar for AssertNull
0
1K
Member Avatar for Roger_2

You need to access each node once, so O(n). The size of the stack is O(log n) so you can ignore that when there's a O(n) component

Member Avatar for Mickey_2
0
422
Member Avatar for pro-tek

When Apple adopt new technologies they usually do it hard and fast. Don't be surprised to see new hardware or software features getting support in Swift first, then before too long, in Swift only. I say switch too.

Member Avatar for JamesCherrill
0
273
Member Avatar for khaled_jawaher

ProcessBuilder was intended as a replacement for Runtime exec, so maybe that will work, but it is a step backwards.

Member Avatar for JamesCherrill
0
458
Member Avatar for nitin1

I'll second the vote for UML. Especially use cases -> component diagrams -> class diagrams -> sequence diagrams (the last 3 in iterative loops of course). For low level design I'm more a fan of Scrum (I was principle consultaint in Easel when Jeff Sutherland championed it) - it's an …

Member Avatar for JamesCherrill
0
1K
Member Avatar for gracekd90

You can talk here as long as you recognise that whatever you say will be visible to everybody. There are many people here who can give you good advice.

Member Avatar for Mickey_2
0
269
Member Avatar for ardywijaya1997

rproffitt did help you. (S)he gave you excellent advice. `"Think about how you do this in your head now. Now ... translate that directly to code. If the step can't be translated into code ... break that step down into smaller steps". If you can't describe how to do it …

Member Avatar for AssertNull
-1
342
Member Avatar for nadiam

To understand this you need to remember: `int[] arrayA = ...` creates a reference variable `arrayA`that holds a pointer to an array `new int[3]` creates an actuial array of 3 elements so ` int[] arrayA = new int[3];` creates an array and creates a pointer to it. line 2 creates …

Member Avatar for JamesCherrill
0
331
Member Avatar for prakash2813

I think you will need separate code for each subject UNLESS you replace the sub1, sub2 etc with a List or array of subjects - which would be code better anyway

Member Avatar for prakash2813
0
275
Member Avatar for Jendalin23

Hi Yes, people here will help, but not many will bother to download a zip file from an unknown source! Post your code here (use the `code` button above the editor) and people will read it.

Member Avatar for AssertNull
-1
633
Member Avatar for Abdennour

There's zero information in that code about where the flag is being drawn, so it's hard or impossible to answer your question. Presumably the missing info is in the various shape classes (MyRectangle etc)? It's also as far from Object Oriented as it's possible to be in Java. Instances of …

Member Avatar for JamesCherrill
0
232
Member Avatar for mattrweaver

Considering names like Gary Del Barco vs Sarah Michele Geller, or Richard Wayne Van Dyke vs Doris Mary Ann Kappelhoff (a.k.a.Doris Day), I suspect what you are asking is impossible without the use of human-level A.I. (Not to mention Edda Kathleen van Heemstra Hepburn-Ruston, a.k.a. Audrey Hepburn)

Member Avatar for snippsat
0
3K
Member Avatar for KrullFX

Maybe just keep with the calculator for a bit? (Small steps for an easy journey) a) Keep doing multiplications until the user signals "stop", eg by entering zero for eiher number (if test, a loop) b) Offer choice of multiply or divide (Strings, if test) b) Offer add/subtract/mult/div (use a …

Member Avatar for JamesCherrill
0
342
Member Avatar for Mar. Na.

As far as I know you can't - it's alphabetical. And judging by the lack of responses it looks like nobody has any better answer.

Member Avatar for Mar. Na.
0
388
Member Avatar for MirorB
Member Avatar for nitin1

In Java 8 all your problems are solved! It includes a completely new package for handling dates, times, intervals etc based on everything that was wrong with the old classes, and stealing a lot from Joda time You just need the `ChronoUnit.between` method with two `Instant` objects Theres a really …

Member Avatar for JamesCherrill
0
835
Member Avatar for nitin1

You seem to be calling those methods as if they were class methods for the `Object` class... which they're not.

Member Avatar for nitin1
0
367
Member Avatar for JOSheaIV

The compiler has to include all those values in your runtime, so any saving is pretty illusionary. Exactly how many bytes/CPU cyles are you saving? As a percentage of the hardware capacity? How many nanoSeconds per run? Don't waste any more time on this kind of "premature optimisation" and concentrate …

Member Avatar for JOSheaIV
0
234
Member Avatar for modernfrt

Nice try Edson, but this thread is a year old, so your answer is too late. You should also update your Java knowledge. `Class.forName()` became osolete with JDBC4, *ten years ago*!

Member Avatar for stultuske
0
6K
Member Avatar for Wilbert_2

Yes. But you must show some effort first - post what you have done so far and explain why you are stuck so someone can give relevent help.

Member Avatar for jone usamate
0
118
Member Avatar for Saboor880

You are using a seriously out-of-date source for your info. The whole Class.forName thing was replaced as of Java 1.4 or 1.5 (Yes, that's more than 10 years ago). Forget the obsolete info you have been given and start again with current Java. Here's the up-to-date tutorial: http://docs.oracle.com/javase/tutorial/jdbc/basics/connecting.html

Member Avatar for Saboor880
0
241
Member Avatar for nadiam
Member Avatar for wrestle23

Hello Mynamo. DId you read this thread before replying? See the comment on the previous post. You are 8 years too late.

Member Avatar for JamesCherrill
0
749
Member Avatar for nitin1

I'm not sure I understand what you are asking, but to call the `getName` instance method of the `ClassA` class you will need an instance of `ClassA`, as in `String s = classAObj.getName();`

Member Avatar for JamesCherrill
0
220
Member Avatar for pretty_4

People here will help, but you must be a lot more specific in your question. We do not know about your current skill level in C#, we do not know what you have done before...

Member Avatar for pretty_4
0
200
Member Avatar for spoch

Well. I'm following it again now... In my opinion, I would rather waste a few miliisecs of CPU than try to debug some highly optimised code that only works most of the time. CPU is cheap cheap cheap, programmers are expensive, bugs are very expensive, so the simplest program is …

Member Avatar for JamesCherrill
0
2K
Member Avatar for letters1417

Yes you can, IF you learn to program and take the time to think through how to do it. If you would like help with either of those please start your own thread.

Member Avatar for JamesCherrill
0
2K
Member Avatar for Stephen_13
Member Avatar for divinity02

Hi THis is almost identical to the problem you had six months ago https://www.daniweb.com/programming/software-development/threads/498758/tell-me-what-is-wrong-with-this and that was almost identical to an even earlier one a year ago https://www.daniweb.com/programming/software-development/threads/489301/payroll But you seem to be learning nothing, and have made no progress. Your persistence is admirable, but I am afraid that you …

Member Avatar for JamesCherrill
0
238
Member Avatar for Mar. Na.

You simply put the code for one file into a method, taking the file name as a parameter. Then you can call that method as many times as you like, passing a different file name each time.

Member Avatar for Mar. Na.
0
275
Member Avatar for AkshatGupta

You need to collect all the data for each row as an array of objects - one element per column, then add that array with `model.addRow(myArrayOfValues);` You can use a Vector instead of an array if that works better for you

Member Avatar for AkshatGupta
0
755
Member Avatar for Gregt1991

Hi Az, welcome to DaniWeb. This thread has been dead for a year now, so it's not a good idea to hijack it. Please start a new thread for your question, and someone will help.

Member Avatar for happygeek
0
21K
Member Avatar for Roger_2

`compareTo` returns an int... v<w returns -1 v==w returns 0 v>w returns +1 so if v is less than w, `compareTo` will return -1, and line 3 will return `true`. Otherwize `compareTo` will return 0 or+1, and line 3 will return `false`.

Member Avatar for rubberman
0
189
Member Avatar for cecsFTL

Yes. The clue is in "You'll want to do this using nested loops." Each loop requires its own loop variable, so your n1, n2, n3 will correspond to 3 nested loops. This won't use any arrays.

Member Avatar for JamesCherrill
0
2K
Member Avatar for joshl_1995

My advice is never do anything you wouldn't want your friends and family (or clients) to know about. Sooner or later they will find out, and in the meantime you are just living a lie.

Member Avatar for jkon
0
719

The End.