Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
Why is there still deprecated content in JDK like Thread.stop()?
On the documentation site here I can see the method is
#Deprecated(since="1.2")
Since 1.2!
Also, there is a note:
This method is inherently unsafe
So why is it still there? The presence of deprecated code can potentially lead to many issues.
There is a whole page from Oracle talking about deprecation in APIs if you want to read about it, but here is a good snippet which sums up why deprecated functions are still in Java:
Deprecation is a reasonable choice in all these cases because it preserves "backward compatibility" while encouraging developers to change to the new API. Also, the deprecation comments help developers decide when to move to the new API, and so should briefly mention the technical reasons for deprecation.
Eventually, it will be removed, but until there is enough confidence that people are not using programs that still utilse Thread.stop(), they will keep it in there, and just let people know that there are much better options to choose from.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I have looked around, and there are no solid guidelines to converting Object Orientated C++ to Java. Most are references to conversion tools.
My question is what are the steps one should take to not get overwhelmed and lost, especially for heavily OO projects.
For example, given one method that accomplishes a task. That method is called, which is dependent on several other cpp, and those helper methods are also dependent on other cpp files, and so on. How should this be addressed?
What are techniques that can be used to break it down, while properly combining .hpp and .cpp?
I understand JNI can be used, however, it is desired to have only Java code, unless something can literally only be done in C++
Tips, suggestions, and ideas will be much appreciated.
PLEASE do NOT mark this as a DUPLICATE, there are only questions posted in respect to specific code, or using conversion tools, not for general techniques.
Also, if this is a terrible question, let me know, I'll take it down, no need to thumb it down. Thank you.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
I am using JSP/Serverlets for my upcoming web application project. It is high traffic concurrent users web site. There has been many discussion about performance issues of Java 8 and especially in Streams.
Anyone having specific knowledge about performance of streams and whether its advisable to use in High traffic Web Applications so as to not compromise on latency and response time ?
As a general statement, outside of Java 8 Streams, it is pretty much impossible to answer your question as stated because it depends.
If you've got a method that is called hundreds of times per second then you would need to be very careful about performance. You'd want to tune it the best you could. Conversely, if you've got a method that gets called once a day then you likely wouldn't spend too much time optimizing it.
Streams are a useful tool when used correctly and they are easy to abuse. I've seen developers who thought it was a great idea to read an entire database table and use filtering with streams to effectively do a SQL "where" clause. That's a bad design but it honestly wouldn't be seen in the once-a-day method call.
Don't try to make these blanket "this is good or this is bad" statements. Do a good design and use the tools where they are appropriate. Optimize the parts of your application that need it but don't do pre-mature optimizations - you'll never finish the project.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
Hi i am new to java and facing difficulties in learning methods and their parameters , tell me the best way of memorizing all methods,interfaces names etc
Use an IDE. Code completion is a wonderful thing. In eclipse I love to type syso ctrl-space and watch System.out.println() magically appear. I love to hover my mouse over a method and have the java docs popup and tell me what it does and what it needs.
Use google. Use stackoverflow. Use github. Use your own code once you've written enough stuff.
Also realize those of us who've been coding for decades still have to look some of this stuff up. So you're not alone.
It also helps to use cheetsheets:
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I recently went for an interview and was requested to submit an example of my production code.
Submitted the code complete with javadocs, but was questioned by the interviewer about my choice of it.
I find javadocs quite useful for understanding code by others and it's really not that much of a legibility issue if I'm using an IDE. Can someone enlighten me on why it may not be recommended and what would be a better alternative in said situation?
Javadocs are not evil, and for Java it's the best you can do to properly document your code.
Being questioned does not mean automatically that what you've done is evil. Questions are mostly to test if you're sure in what you do and if you know more about it or you just made a guess.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I am working on a code base which was developed 2 years ago. The code used jai-imageio (as a dependency from dcm4che). Apart from running into many problems(64bit win OS etc), I discovered that there are many different ways of handling imageio in Java now. A few of them being:
https://github.com/jai-imageio/jai-imageio-core (old but still used in many projects)
https://github.com/geosolutions-it/imageio-ext/ (jai-imageio page recommends it)
http://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html (included in Java)
I would primarily be dealing with DICOM images and JPEG2000 format, but since I am in process of upgrading the code-base, which of these(or other) is the most preferred/recommended way of performing imageio with Java ?
I think this is pretty subjective and will likely be closed as such, but in my opinion, unless there's a compelling reason for you not to use the standard Java library, give it a go and see how you get on. At the very least it will reduce the dependencies that your project has, which is always a plus.