-
Replied To a Post in Static Final String to Enum
If they take no parameters, then just return the appropriate Color like the examples in the enum code above. But since those methods don't seem to create anything, let alone … -
Replied To a Post in Static Final String to Enum
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 … -
Replied To a Post in an array index out of bound exception: 2
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 -
Replied To a Post in Randomized question doesn't appear
I can't comment on yur code becuase I don't have the actual version you are running, so it's time for you to do some debugging... Add print statements to your … -
Replied To a Post in Populating an Arraylist from a text file
Which line is generating the Exception? The third `next()`? Scanner looks like a good idea for beginners to use, but in reality it's full of little traps that cause all … -
Replied To a Post in Randomized question doesn't appear
questionrandomizer() isn't going to do anthing because you never call it. -
Replied To a Post in Why does this program fail to display the entire message?
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 … -
Replied To a Post in Program to compute the definite integralno
Sandeep: You just copy/pasted your assignments 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 … -
Replied To a Post in GUI Input transfer?
Yes, Java is way too heavy for this simple application, and something like Python is far more appropriate. But the real question is: where are you going next? People use … -
Marked Solved Status for GUI Input transfer?
I have a problem with a project i'm working on, and I was wondering if it was possible to do what i'm thinking. Basically I have a simple mathematical GUI. … -
Replied To a Post in Quick Help with minor code error
// call this once that's right. You call it twice. the number you read first (line 18) is never used, and is immediately replaced by the second number (line 23). … -
Replied To a Post in package in java
Hint: Some of the classes you can use without an import include String and System. What package are they in? -
Replied To a Post in what is wrong here
Why download Eclipse when you already have NetBeans? Whay do you think Eclipse can possibly do for you at this stage? Eclipse won't give you anything more than Netbeans for … -
Replied To a Post in Class As A Reference Datatype
What exacetly do you need clarified? -
Replied To a Post in Julian Day vs the Date object to get the present day
Ignoring personal bias for the moment... GregorianCalendar's implementation does indeed use an epoch value (millisecs since some arbitrary start point) which is what most people mean when they say "Julian". … -
Replied To a Post in programming in java for the first time
I agree with stultuske re tutorials Also, books are always out of date by the time they are printed. Not to mention expensive. -
Replied To a Post in Can you develop mobile apps for android, windows & ios using Java
Android: yes Windows: yes, but it's not the best option IOS: No, not possible <edit> Seems I was wrong about that - see OMAF below </edit> Having said that, switching … -
Replied To a Post in things keep in mind
It's a cliche, but software lasts long beyond its initial expected life. Management have some rose-tinted idea that they can replace it in 2,5,8 years or whatever, but once it's … -
Replied To a Post in things keep in mind
Someone else is going to have to read and understand it. Whatever the requirements are now, they will change. -
Replied To a Post in Map.get returns LinkedList instead of String
I already asked him that yesterday. He's not responding. It's starting to look like he has spotted his error and has moved on without the basic courtesy of letting us … -
Replied To a Post in How to write proper code
Method 1: (Object...params) That's as unhelpful and error-prone method signature as I can imagine. You have no idea what the arguments should be, and the compiler can do nothing to … -
Replied To a Post in Julian Day vs the Date object to get the present day
I'm not familiar with the Android version of Java, but in "real" Java almost all the methods in Date were also deprecated around 1997 in favour of GregorianCalendar. So if … -
Replied To a Post in Julian Day vs the Date object to get the present day
Is this Android code? If so, just note that `Time` is full of problems and thus was deprecated in API level 22 in favour of `GregorianCalendar`. (Which in turn was … -
Replied To a Post in Map.get returns LinkedList instead of String
What does the call to that method look like and how is its parameter declared? I don't see how you can pass a `Map<String, LinkedList>` to a method that requires … -
Replied To a Post in Problem in (Txt) files !( Netbeans )
Sorry, I don't know to make that any clearer. Just re-read the post and thuink about it... -
Replied To a Post in Problem in (Txt) files !( Netbeans )
Some comments: That code is hard to read because: The indentation is all over the place - use NetBeans to forma the code properly You ignore Java naming conventions - … -
Gave Reputation to Labdabeta in Get input from another class
Judging by your code it looks like you are doing Android development and trying to pass data from one activity to another. Due to the nature of Android activities (multithreaded, … -
Replied To a Post in Get input from another class
`apply()` just sets a listener. How can it possibly return a value for radius? You don't have a value for radius until after the onClick is executed, and the onClick … -
Replied To a Post in Get input from another class
All that `apply()` does is to set a listener. For the `radius` method you need an actual numeric value, which `apply()` does not supply. I'm curious about this mistake. What … -
Replied To a Post in Files (Txt) in netbeans !
A list of Book objects is a very good start. You can add Books to it, or delete them, or update them by changing the values in their variables. For … -
Replied To a Post in JFrame Code
What about it do you not understand? ps: You claim to be the author of that code, so how did you write it if you don't understand it? -
Edited JFrame Code
# PLEASE some one help me to explain the code. This code is for a ScientificCalculator # package calculator; import java.math.*; //@author Hadisur Rahman public class ScientificCalculator extends javax.swing.JFrame { … -
Replied To a Post in is it better to log exception or exception.getMessage()
`printStackTrace()` is really valuable when debugging, but is not something you would typically do in a live production system for the reasons discussed in that link. When logging in a … -
Replied To a Post in is it better to log exception or exception.getMessage()
You wouldn't need it for info, and probably not for well-designed debug logs, but if you need to trace an error then it's near essential. It doesn't cost much, and … -
Replied To a Post in is it better to log exception or exception.getMessage()
Personally I always want the complete stack trace, not just the error message -
Replied To a Post in Udp server too slow?
Is it OK just on your LAN? If so, maybe you are using a dynamic DNS and that's a slow lookup??? -
Replied To a Post in C++ 11 thread equivalent of pthread barrier
Is there a C++ equivalent of Java's [CountdownLatch](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CountDownLatch.html)? -
Replied To a Post in what is wrong here
*In my opinion* the Eclipse debugger has a very steep learning curve, and is far too difficult for someone who hasn't started learning about threads yet. For a beginner I … -
Replied To a Post in Junit testing
This is easilyy resolved... what are the names of all the classes in your app? -
Replied To a Post in Moving files problem
I doubt it. `flush()` will ensure that any buffered data Java has in memory will be written to the stream, but it will leave the stream open, so the file … -
Replied To a Post in How to avoid multiple if statement in code?
HArd to create a elevant example without a lit mroe info, but the essence of it is just abstract class Workflow { // methods common to all workflows abstract public … -
Replied To a Post in How to avoid multiple if statement in code?
If it is the case that: Parking, Loan etc are all a `kind-of` Workflow `and` There is a lot that's common to all of those, but each has it's own … -
Replied To a Post in tell me what is wrong with this
This has all the same kinds of mistakes that we discussed in one of your earlier posts - eg almost-duplicated variables, results calculated but never used, results never calculated, no … -
Replied To a Post in Moving files problem
`fis.close();` etc, of course -
Replied To a Post in java error: the file cannot be validated as the host “www.getahead.ltd.ukâ€
It's probbaly unreachable becuase it doesn't exist... `.ltd.uk` does not look like a normal UK URL. They normally end with `.co.uk` -
Replied To a Post in programming in java for the first time
Are you looking for a tutorial? There are lots on the web. -
Replied To a Post in Query does not return results
"if a connection fails to close because it was already closed, I would like to know." Fair enough (although for most streams etc a second close will just be ignored). … -
Replied To a Post in Moving files problem
In that first piece of code you definitely need to close the streams. -
Replied To a Post in java error: the file cannot be validated as the host “www.getahead.ltd.ukâ€
the host "www.getahead.ltd.uk" is currently unreachable what is it aboiut that mesage that you don't understand? -
Replied To a Post in Query does not return results
"code like that is always bad." Actually that is the one place where an empty catch is often OK - inside a `finally` block where yoy are just trying to …
The End.