1,171 Posted Topics

Member Avatar for sk8ergirl

>I want to know how can I return ArrayList You are actually doing this already. In the code that you posted on line 4 you let `res` be a reference to a List, and set it to refer to an ArrayList. On line 20 you have `return res;` which will …

Member Avatar for tux4life
0
253
Member Avatar for toldav

>Also my print format doesnot display the $ and the headers. Take a look at the [DecimalFormat](http://docs.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html) class. >I need the year 1 to be the initial value without doing the percent first Print out the balance before adding the interest to it. Are you required to use loops?

Member Avatar for toldav
0
177
Member Avatar for dicknballs

You can never obtain the exact value of PI, you are always bound to the limitations of memory and computation time. Also a perfectly correct answer is not always needed in all circumstances. Therefore it makes sense to determine how correct you want the answer to be and use an …

Member Avatar for tux4life
0
649
Member Avatar for StefanRafa0

>i dont know how to create tables in sql but i have make account hope u will come to help me i send you email ... :) Congratulations, you just limited your chances of getting good advices. In this context email is far less productive to get answers than a …

Member Avatar for tux4life
0
359
Member Avatar for bhadra.anurag
Member Avatar for VernonDozier

I remember [this](http://www.daniweb.com/software-development/c/code/216515/checking-for-integer-overflow) snippet from [Dave Sinkula](http://www.daniweb.com/members/5020/Dave-Sinkula).

Member Avatar for deceptikon
0
176
Member Avatar for sk8ergirl

In addition: don't forget to [close the file](http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html).

Member Avatar for tux4life
0
777
Member Avatar for sk8ergirl

>I know how to read file from data and split each line using array Then I fail to see what the problem is. Pretty much the same question as [your other thread](http://www.daniweb.com/software-development/java/threads/446764/reading-data-from-file-to-arraylist). [This post](http://www.daniweb.com/software-development/java/threads/446764/reading-data-from-file-to-arraylist#post1927976) should get you started.

Member Avatar for tux4life
0
159
Member Avatar for Violet_82

It all depends on how you read your number: if you read it in as int, use the modulo 10 divide by 10 approach. On the other hand if you read your number as a String you can either loop through all characters in the String and convert each character …

Member Avatar for Violet_82
0
580
Member Avatar for deadsolo

>is it nessasary to use regular expression concept to get your actual output? >may i suggest any alternate solution to your requirement? >isn't it good to use split() for this requirement? What do you think [split()](http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#split(java.lang.String)) uses? Here's its signature: `public String[] split(String regex)` API: *Splits this string around matches …

Member Avatar for deadsolo
0
299
Member Avatar for Goldfinch
Member Avatar for DEAD TERMINATOR

>it won't be an 2d array anymore I can't go something like 'matrix[i][j]')? Anybody have any ideas, or am I approaching this completely wrong? While in other languages such as C# or C++ you have operator overloading, there's no such feature in Java. Your best bet is creating a method …

Member Avatar for tux4life
0
244
Member Avatar for Forte1292
Member Avatar for necrovore

I know I am nitpicking, but the backslashes need to be doubled in: `mkdir("c:\one\two\three")`.

Member Avatar for Moschops
0
198
Member Avatar for numbplum

Instead of defining the name attribute as of type `char *`, I'd define it using the **std::string** type instead.

Member Avatar for Ketsuekiame
0
1K
Member Avatar for silvera

>please correct the problem with the Braces... What do you mean by "problem with the braces"? Are you referring to code indentation? If so, run your code through a code formatter / code beautifier. If you're using an IDE look if there's an option available, most IDEs come with a …

Member Avatar for Ketsuekiame
-2
216
Member Avatar for hwoarang69

*File* -> *Import* -> *Existing Projects into Workspace* (under *General*) -> *Next* -> *Select root directory*: use the *Browse...* button and browse to the Workspace directory which contains the projects to be imported. -> from the *Projects* list select the projects you want to import into the Workspace (or use …

Member Avatar for tux4life
0
144
Member Avatar for zlloyd1

What is the type of your variable? Does the output file have to be *human-readable*?

Member Avatar for Banderson
0
4K
Member Avatar for pattmorter

The following lines are causing compilation errors: // lines 16-19 program.main(arg[0]); // line 16 program.main(arg[1]); // line 17 program.main(arg[2]); // line 18 program.main(arg[3]); // line 19 You declared `arg` as follows: String[] arg = new String[4]; // arg is a reference to a String array On lines 16-19 you index …

Member Avatar for pattmorter
0
203
Member Avatar for saurabh.mehta.33234

[About printf and sizeof #1](http://www.daniweb.com/software-development/c/threads/224617/converting-hex-to-decimal#post992334). [About printf and sizeof #2](http://www.daniweb.com/software-development/c/threads/224617/converting-hex-to-decimal#post992369).

Member Avatar for deceptikon
0
397
Member Avatar for xHellghostx

What exactly do you mean by *vector*? Do you mean the [Vector](http://docs.oracle.com/javase/6/docs/api/java/util/Vector.html) class? [ArrayList](http://docs.oracle.com/javase/6/docs/api/java/util/ArrayList.html) is much more common nowadays, prefer that container class over Vector. As stated in the API: *This class is roughly equivalent to Vector, except that it is unsynchronized.* Also you don't need a loop, you can …

Member Avatar for tux4life
0
605
Member Avatar for Violet_82

Add a PATH entry for the *bin* directory of your JDK installation. For example if your JDK's *bin* directory is located at `C:\Program Files\Java\jdk1.7.0_10\bin` Then you'd add that to your PATH like this: *C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common; %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem; %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\Toshiba\Bluetooth Toshiba Stack\sys\; C:\Program Files (x86)\Toshiba\Bluetooth Toshiba …

Member Avatar for vishnu.khera.5
0
440
Member Avatar for P3C1
Member Avatar for cgogte

Already looked [here](http://www.daniweb.com/software-development/java/threads/99132/starting-java-java-tutorials-resources-faq)?

Member Avatar for ~s.o.s~
-1
155
Member Avatar for E.RANJANI
Member Avatar for Asmaa_2

@AD: toupper() and tolower() seem to return int and not char. Also if I recall correctly C++ has new style headers: `#include <cctype>`.

Member Avatar for MandrewP
0
500
Member Avatar for YaLeon

The quick and dirty way to fix it would probably be creating a separate instance variable to help in the recursion. **Edit: Bad approach, don't use it. See later posts.**

Member Avatar for tux4life
0
177
Member Avatar for deceptikon

I am wondering if the Builder pattern would be a candidate for being applied here? Let me know your opinion.

Member Avatar for tinstaafl
2
3K
Member Avatar for sbharathind

Your algorithm is more complex than it should be, compare with the following: iterativeInorder(node) parentStack = empty stack while not parentStack.isEmpty() or node != null if node != null then parentStack.push(node) node = node.left else node = parentStack.pop() visit(node) node = node.right (Source: [Tree Traversal - Wikipedia](http://en.wikipedia.org/wiki/Tree_traversal))

Member Avatar for sbharathind
0
234
Member Avatar for alpzee

This is probably caused by your default locale setting for a decimal separator (which is probably a comma instead of a point). More info: http://docs.oracle.com/javase/6/docs/api/java/util/Scanner.html#localized-numbers

Member Avatar for alpzee
0
166
Member Avatar for mumaga

[Apache POI](http://poi.apache.org/spreadsheet/index.html), recommended two weeks ago in [this post](http://www.daniweb.com/software-development/java/threads/444012/read-from-text-file-and-write-to-excel#post1912524).

Member Avatar for stultuske
0
218
Member Avatar for Yogeshp

Did you put a component scan into your beans configuration file? More info: http://static.springsource.org/spring/docs/3.0.0.M3/reference/html/ch04s12.html

Member Avatar for Yogeshp
0
310
Member Avatar for doomsday1216

Yeh, but be careful for "micro-managing exceptions", sometimes you need to put a statement that doesn't throw an exception in a try block to guarantee that it won't execute if an exception is thrown from another statement that comes earlier in that try block. However, apparently the OP deleted the …

Member Avatar for stultuske
0
126
Member Avatar for <M/>

The following Java books are on my shelf and I consider them as very good: (haven't read these cover-to-cover though) * Kathy Sierra & Bert Bates - Head First Java: Introductory Java book * Elisabeth Freeman & Eric Freeman & K.S. & B.B. - Head First Design Patterns: Good read …

Member Avatar for <M/>
0
347
Member Avatar for Archit Gupta
Member Avatar for ambageo

In the Java Language Specification I read the following: "The result of a floating-point division is determined by the specification of IEEE arithmetic:" ... "Division of a nonzero finite value by a zero results in a signed infinity." (Source: [JLS - 15.17.2 Division Operator](http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.17.2))

Member Avatar for ambageo
0
125
Member Avatar for YaLeon

It's also possible using two HashSets, one that keeps track of the elements that occur only once, and another that keeps track of the elements that occur more than once. At the end you check the size of the first HashSet, and if it is not empty you know that …

Member Avatar for tux4life
0
178
Member Avatar for mattboy64
Member Avatar for mattboy64
0
225
Member Avatar for StefanRafa0

@vijayan121: Any specific reason why you chose to recurse on Problem 1 - Line 11? If the user enters a wrong input 5 times, then that function will return 6 times. I would suggest a do while to avoid that.

Member Avatar for Lucaci Andrew
0
259
Member Avatar for annieshvijay

Read the [rules](http://www.daniweb.com/community/rules) and make sure you understand them. After that if you're still interested you could come back, reformulate your question and post your own attempt and point out which difficulties you are facing.

Member Avatar for G_S
-5
100
Member Avatar for mattboy64

>does he mean incorporating arrays and such? Why are you asking us and not your teacher? As it stands now it's a bit of a mess... * You're using unportable stuff like conio and [system("cls")](http://www.gidnetwork.com/b-61.html). * Try to replace the recursion in your input routines by iterative constructs. * Remove …

Member Avatar for mattboy64
-1
210
Member Avatar for mumaga

Your question seems pretty vague to me. However you could keep a copy of the initial game state somewhere and restore it when the game needs to be restarted. There are different ways to restore to the initial state of the game, and which one to pick depends on the …

Member Avatar for tux4life
0
178
Member Avatar for ThatBitchYeah

Line 19 - `scanf("%c",&ch);` This is overkill ([reason](http://www.gidnetwork.com/b-60.html)).

Member Avatar for ThatBitchYeah
0
337
Member Avatar for ThatBitchYeah

>i'm wanting to do separate programs for each (aka one program for adding one for subtracting) is this possible? Yes.

Member Avatar for ThatBitchYeah
0
1K
Member Avatar for kw42chan
Member Avatar for kw42chan
0
268
Member Avatar for plang007

> you can download dos-box turbo c++ from internet. it will work on all versions of window including win 7 and win 8 also > > try it now Why doing so many effort for something that is worse?

Member Avatar for plang007
0
335
Member Avatar for dannyboy.rizaldo
Member Avatar for tux4life
0
138
Member Avatar for mumaga

There's no need to write your own logger. There are frameworks available for that. If you're interested, you might want to take a look at these links: * [java.util.logging (JUL)](http://docs.oracle.com/javase/6/docs/api/java/util/logging/package-summary.html) * [Apache log4j](http://logging.apache.org/log4j/2.x/) * [Logback](http://logback.qos.ch/) * [Simple Logging Facade for Java (SLF4J)](http://www.slf4j.org/)

Member Avatar for Taywin
0
11K
Member Avatar for sandeepbhatia

You're using Eclipse for Java EE Developers right? *Window > Preferences > Server > Runtime Environments > Add > **Download additional server adapters*** (link)

Member Avatar for peter_budo
0
136
Member Avatar for Blink383

@Override public void actionPerformed(ActionEvent ae) { double p = Double.parseDouble(pricefield.getText()); double d = Double.parseDouble(discountfield.getText()); double sum = 0; while (p < sum && d < sum) { sum = p * d; calc.setText(sum); } } You initialize sum to 0, hence if you enter a value bigger than zero in …

Member Avatar for Blink383
0
471

The End.