7,116 Posted Topics

Member Avatar for Dean_Grobler

Please note that there is a stick thread for exactly this - it's the first topic in the Java forum http://www.daniweb.com/software-development/java/threads/430542/java-projects-for-learners your additions to that thread will be very welcome.

Member Avatar for JamesCherrill
0
758
Member Avatar for Shft

The Java language shouldn't cause you any problems at all (apart from some stuff around generics maybe) - it's just C++ for people with more than 16k RAM and no love of fatal addressing errors. The Java API is the real issue here. Java comes as standard with a vast …

Member Avatar for JamesCherrill
0
119
Member Avatar for ganges
Member Avatar for ganges
0
4K
Member Avatar for pwolf

The source code of the entire Java API can be downloaded form Oracle. That's as high-quality as anything gets.

Member Avatar for pwolf
0
481
Member Avatar for Rajveer456
Member Avatar for stultuske
0
70
Member Avatar for C

There's a mistake you make on lines 17, 45, 49 and 54. You try to change the value of a parameter in a method. That's perfectly legal Java, but it won't do what you want. Java parameters are always passed as a *copy* of the original value. On line 17 …

Member Avatar for C
0
324
Member Avatar for murali2489

The answer. as always, is in the doc, the Java Language Spec in this case. Section 15.12.2.5. > 15.12.2.5 Choosing the Most Specific Method > If more than one member method is both accessible and applicable to a method invocation, it is necessary to choose one ... The Java programming …

Member Avatar for murali2489
0
186
Member Avatar for sara12234

+1 for the Oracle doc, especially the tutorials. The other problem with books is that they get out of date. Remember there is a HUGE update to the Java language being released ths month. ALl the relevant doc is on the Oracle site, but it won't be in your book.

Member Avatar for ckide
0
324
Member Avatar for ParPau

After the for loop (Lines 34-38) i will be >= CurrentMonth.length, so that's why you have the error - array index out of bounds on line 45

Member Avatar for ParPau
0
280
Member Avatar for firepower
Member Avatar for JamesCherrill
0
210
Member Avatar for V3N0M

miles_per_gallon = miles / gallons; Because miles and gallons are both ints this division is done in int arithmetic. After that, the result is converted to double to match the target variable miles_per_gallon, but by then it's too late.

Member Avatar for JamesCherrill
0
210
Member Avatar for gyno

The kind of bracket is important, [] is not the same as {} The number in [] defines the size of a new array... new int[7] is a new array of 7 ints, all zero The numbers in {} are a quick way of specifying the initial values of a …

Member Avatar for JamesCherrill
0
142
Member Avatar for firepower

To close a JFrame and release all its resources you can call its `dispose()` method.

Member Avatar for mKorbel
0
166
Member Avatar for sankubha

... but seriously, can you explain in more detail what you need? The brief sentence you posted didn't seems to make any sense.

Member Avatar for sankubha
0
221
Member Avatar for Pavan_5

Realistically, I doubt that anyone is going to spend any time trying to understand undocumented unindented code with meaningless variable names. Maybe you could make it a bit easier?

Member Avatar for JamesCherrill
0
429
Member Avatar for Nimalshi

create an instance of the class Stack<String>, let's suppose it's called "theStack", then just pass that to the print method: print(theStack);

Member Avatar for JamesCherrill
0
226
Member Avatar for Mr.M

One simple way is the use as many 200 as possible, then as many as 100 etc until what's left can be done in 10s. If you get this version working then it should be easy to upgrade to more complex "A.I." algorithms to give "desirable" mixes of notes

Member Avatar for JamesCherrill
0
144
Member Avatar for essuku

Not in the standard API, no. May I guess that you have been set this as an exercise?

Member Avatar for C-Money
0
211
Member Avatar for woomar

Why not look atthe API doc for java.util.HashTable and its inner HashTable.Entry class. That will give you a good idea of what the public parts of a typical implementation look like. For your Entry constructor, there's no need for the hash parameter because every `key` has it's own hash - …

Member Avatar for JamesCherrill
0
213
Member Avatar for Xabush

Hi Xabush. Welcome to Daniweb. I'm not going to join in any sematic debate about "intermediate", but I will refer you to the top sticky in this forum, which is a compendium of useful resources for learners. Doing actual projects is the best way to learn, so the second sticky …

Member Avatar for C-Money
0
234
Member Avatar for ZaneDarklace

Once you have the array sorted ascending then you get the descending order by simply starting with the last element and working all the way back to the first. Ie, if there are (n+1) entries entries, then the ascending sequence is indexes 0 - n, and the descending sequence is …

Member Avatar for C-Money
0
238
Member Avatar for AhmadHasanSahi

I want, I want... There are lots of things we all want, but life isn't like that. DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules

Member Avatar for C-Money
-3
150
Member Avatar for polpulpol

I think you have confused us with people who will do your homeowrk for you for nothing? If you have *specific* questions or problems then post them here and someone will help.

Member Avatar for C-Money
0
91
Member Avatar for mukulnimker7751

> Do anyone have idea how to execute batch command in java. http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html

Member Avatar for JamesCherrill
0
369
Member Avatar for Aya Safi

Line 10 you calculate Math.pow(x, i); but you don't do anything with the result.

Member Avatar for jwenting
0
213
Member Avatar for newbie14
Member Avatar for lrw0831

Welcome to DaniWeb, and thank you for trying to help here, but after three years it's probably a bit late! ps: When you help answer people's problems please try to explain why they have the problem and how they should start to fix it themselves. Don't just post corrected code …

Member Avatar for stultuske
0
1K
Member Avatar for yamini222

You can add a TextListener to each text field (and ChangeListeners to radio buttons etc etc). You can use the same listener code for all of them - all it has to do is enable the Save button.

Member Avatar for JamesCherrill
0
1K
Member Avatar for anku83

Create a Map with the row values as key and an Integer count as value. For each row, if that value is already in the map, increment its count. If it's not in the map add it with a count of 1. You may need some convenient representation for the …

Member Avatar for gon1387
0
250
Member Avatar for javalearner1

Do you mean that you want the user to be able to type in 2 polynomials that you can then multiply using your existing code?

Member Avatar for sara12234
-1
238
Member Avatar for Lius

Hi Lius. The purpose of your project is for you to learn and practice Java programming, not Googling. The only way to understand how to code this is to start at the beginning and solve each problem as you encounter it. We will help with that. You have a short …

Member Avatar for Lius
0
2K
Member Avatar for cheryl.stradford

That's the "hello world" program that is the first program you learn in any language. There are many many suitable tutorials on the web.

Member Avatar for JamesCherrill
0
39
Member Avatar for asaidi

Eclipse comes in many different (free) versions, supporting different subsets of usage. You need to download a version that suports as much as possible of your needs, then download the remining pieces that you need. It's all explained here: https://www.eclipse.org/downloads/compare.php?release=kepler

Member Avatar for JamesCherrill
0
135
Member Avatar for Cris_1

DaniWeb Member Rules (which you agreed to when you signed up) include: "Do provide evidence of having done some work yourself if posting questions from school or work assignments" http://www.daniweb.com/community/rules Post what you have done so far and someone will help you from there.

Member Avatar for JamesCherrill
0
164
Member Avatar for pwolf

Ideally you should enums for Suit and Rank - but maybe you have not covered enums yet in your course.

Member Avatar for pwolf
0
346
Member Avatar for Ghost

Hello DeepakNarang Here at DaniWeb we try to help people learn Java and develop their Java skills. We do NOT do people's homework for them. Your post explains and teaches nothing. In future please help by pointing people in the right direction - eg tell them which classes and methods …

Member Avatar for JamesCherrill
0
3K
Member Avatar for pekemp23

That Class.forName hasn't been needed since JDBC 4. From 4 onwards drivers have registered themselves in their jar file manifests. JDBC was released in 2007 with JRE/JDK 6 https://today.java.net/pub/a/today/2007/04/10/whats-new-in-jdbc-40.html

Member Avatar for jwenting
0
454
Member Avatar for firepower

What size do you want it to be? Eg If you have multiple buttons do you want them all to be the same size? setPrefferedSize is a last resort really ,because you set the size in pixels the when someone runs yur code on a retina display it looks really …

Member Avatar for JamesCherrill
0
275
Member Avatar for asaidi

The compiler is your friend. If you compile this code the error messages wil show you some things to fix. In the meantime, here are some points: You create Person objects, but you put name and age into the Map. Shouldn't it be something more like (eg) name as key …

Member Avatar for SynThiicQ
0
226
Member Avatar for sciprog22

The client code above reads a single byte array from the socket then closes the socket. Obviously that's not going to read multiple objects! Is there some other code you have that at least *tries* to read multiple objects? ps I have plenty of working systems that send mutiple objects …

Member Avatar for sciprog22
0
438
Member Avatar for Xabush

For simple images in Swing just read them into an ImageIcon and pass that to a JLabel. You now have a JLabel that's the same size as the image, containg the image, and you can position it using LayoutManager of your choice. The GUI builders in the big IDEs are …

Member Avatar for mKorbel
0
289
Member Avatar for r.nair3456

C# and Java are almost identical languages - switching between them is easy. .net is comparable with the Java API in function and scope, but differs totally in the details. They are both vast, take ages to learn a decebnt subset, but there's almost no specific knowledge that you can …

Member Avatar for jwenting
0
223
Member Avatar for asaidi

What value should checkGuess return if the numbers are not equal? (Not -1, but what?). You left that bit out when posting the requirements. Anyway, in your code you create Strings like "Greater than the guess" then try to parse that as an int value. That won't work because the …

Member Avatar for JamesCherrill
0
248
Member Avatar for mitul1719

There are lots of people here who will freely give their time to help you become the best Java programmer you can be. There's nobody here who is interested in helping you cheat or doing your homework for you. DaniWeb Member Rules (which you agreed to when you signed up) …

Member Avatar for jayshri.shah.10_1
0
112
Member Avatar for murali2489

`is.read(bytes)` reads some number of bytes into the array, then returns an int with the number of bytes actually read. That value is assigned to the variable `read`. Depending on the type of stream that may be a complete array-full of bytes, or some smaller number, or even, in theory, …

Member Avatar for JamesCherrill
0
308
Member Avatar for sk8ergirl

It's certainly legal Java to append strings like that, but horribly inefficient - every + or += creates a new String object. When you want to build up a String like that you should use a StringBuilder, which is a mutable class with methods like append(...) that are very efficient. …

Member Avatar for Tarek_2
0
162
Member Avatar for pwolf

Line 11: You forgot to declare the type of the parameter. Line 13: That's not how to fix the <parameter with the same name as a variable> problem. Use `this` to refer to the variable, eg this.mode = mode; For what you are doing so far, I think you're right …

Member Avatar for JamesCherrill
0
345
Member Avatar for sciprog22

Just to clarify what you said: if you `append` the text to the textarea it works ok, but change that one method to `setText` then it doesn't?

Member Avatar for sciprog22
0
432
Member Avatar for anisha.silva

... and if not maybe someone has some ideas about how to write one? That would be a really ace project.

Member Avatar for anisha.silva
0
221
Member Avatar for firepower

^ like he said. Post the code you use to create and set the initial position of the button, so someone can give you the appropriate answer.

Member Avatar for stultuske
0
266

The End.