I get the following error when running codes in Spring Tool Suite. …………………………………………………………………… Port 8080 required by Pivotal tc Server Developer Edition v3…
java check if digits in square of a number are not in its cube
Define a positive number to be isolated if none of the digits in its square are in its cube. For example 69 is n isolated number because 163*163 = 26569 and 163*163*163 = 4330747 and the square does …
How to hide TableView column header in JavaFX 8?
I need to have an observable list of a type that will be displayed in a TableView with one single column, that when selected will display the rest of its information on the right. The TableView is wrapped in a TitledPane, which is wrapped in an Accordion. See image below: As you can see in this scenario I don…
Adding null values to arraylist
Can I add null values to an ArrayList even if it has a generic type parameter? Eg. If so, will return 1 or 0? If I can add null values to an ArrayList, can I loop through only the indexes that contain items like this? Or would the for each loop also loop through the null values in the list?
String vs StringBuffer. Tip of IDEA
Intellij Idea offers to replace the following: To: As far as I know it’s less effective (mutable/immutable). So, what’s better? Answer The second one compiles to the same byte-code as the first one, except it uses a non-synchronized StringBuilder instead of a synchronized StringBuffer. So it’…
JDK error when trying to start Android Studio
I have just switched from Windows7 to Windows8.1 and I’m having trouble making Android Studio work now. I have installed Android Studio and the JDK. First I tried it out with the latest versions Android Studio v.0.8.14 and JDK 1.8, but I could not get it to work. I then tried to use the versions I used …
Unit testing a class with a Java 8 Clock
Java 8 introduced java.time.Clock which can be used as an argument to many other java.time objects, allowing you to inject a real or fake clock into them. For example, I know you can create a Clock.fixed() and then call Instant.now(clock) and it will return the fixed Instant you provided. This sounds perfect …
Why String created using new operator creates string literal in string pool
My Question is what’s the use of creating string object in string pool as well as on Heap when we declare String as String a = new String(“abc”); What is the advantage ? And why not we create string in heap when we create string as String a = “abc”. Answer The java language was d…
What is the difference between Transaction manager and Entity Manager
As a student, i read nearly all spring documentation. As far as i understood that spring is configuration monster. Annotation based or Xml based, it doesn’t matter but what i really don’t understand is what is the difference between transaction manager and entity manager. If we have injected entit…
DailyRollingFileAppender alternative in Log4j 2x
DailyRollingFileAppender was removed in Log4j 2x. What should be used instead? Answer Use a RollingFile 1 with TimeBasedTriggeringPolicy 2. e.g.: See more in Apache Log4j 2 User’s Guide [PDF]. Notes org.apache.logging.log4j.core.appender.RollingFileAppender org.apache.logging.log4j.core.appender.rolling…