This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!

Michael Krimgen

Ranch Hand
+ Follow
since Jul 08, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
4
Received in last 30 days
0
Total given
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Michael Krimgen

Done! Good luck with your research!
1 day ago
Hi Roberto,

I have two questions regarding the content of your book.

a) Does the book also cover the cryptographical details of the blockchain? Or is the reader expected to know these?
b) I see that there is a chapter on Unit testing the application. Is integration testing also covered?

Cheers,
Michael
3 months ago
Hi Mark,

You should consider making your code more readable, so it's easier to understand for people to review your code. Here are some points to consider:

- You have one long method with nested for/if. Consider using methods. You could, for example, create a method which takes a Strings and a number n as input and prints the string n times.
- Try to find an alternative for the first_time / second_time.

5 months ago
Hi Peter,

Does the book point out which are Java 11 specific features, so the reader can easily see which Java 11 improvements are applied in the projects presented in the book?
9 months ago
You could use a switch with an enum. This could be an option if you want to reuse the conditions and keep the switch short.
Here is a simplified example. Please note that I do not advocate this pattern, but it might be appropriate in some cases.

10 months ago
Hello,

I recently read about the possibility to create a java compiler plugin, a feature which was added in version 1.8.

The only resources I could find are:
https://de.slideshare.net/AlexandrRadchykov/code-generation-with-javac-plugin
https://www.baeldung.com/java-build-compiler-plugin

I am looking for some good use cases for a plugin and examples of plugins which actually do more than can be
done with annotations and reflection.

Has anyone here used a compiler plugin and for which purpose?

Thanks,
Michael
10 months ago
Note that you are assigning a character to your variable a, not an integer value. If you want the value of a to be 7, you should write:

int a = 7;

(without the singel quotes)
11 months ago
Thanks Shai, for your swift and elaborated answer!
11 months ago
Hi Iar ral,

Could you explain in more detail what exactly is the problem with your code instead of only posting the method.

Cheers,
Michael
Hi Shai,

Do you know if Uber is actually using Kotlin? And if so, for the Android app or in the backend?

Cheers,
Michael
11 months ago
Hi Shai,

Do you also cover the following two topics in your book?

1. Analytics: I believe that a big success factor for such an app is the ability to analyse user behaviour and try to predict what users want. I understand that the book is not about Data Science or Analytics, however, I think it would be interesting to know how to build an app in such a way to make analytics or things like AB testing easy to apply.

2. Security / Performance

Cheers,
Michael
11 months ago
Hi Ben,

I recently started to develop in Kotlin. Would the topics covered in the book also be helpful for Kotlin developers?
Or more general, for developers of any other language running on the JVM?

1 year ago
I would like to execute Java code which users can enter into a form on a website. The output should be written to the console on my server.

I came up with the following setup:
1) Create a Docker container with a JVM where the code is executed.
2) Use the Java Security Manager to allow only the use of certain (Java core) classes, restrict network access, file access etc.

Here are some examples of website where you can upload code to be executed.
  • https://try.kotlinlang.org
  • https://www.jdoodle.com
  • https://www.hackerrank.com


  • What are your thoughts about this approach? What are the security issues with the above set up?
    1 year ago
    Hi Prashanth,

    First of all good luck with your exam. I hope you did some some decent preparation in the past few days.

    I passed the OCJP exam about a year ago and would like to give one hint regarding writing code for practice.
    Many people point out the importance of coding in Java. This is certainly true, however, I think it is crucial not only
    to program "useful" application but play around as much as possible. If you program something real (or some toy project),
    you only use certain aspects of the language (usually only a really tiny subset).

    So what you might want to do is the following: For every mock-exam question which you do not fully understand, you should
    write a few small test programs. Try to code, compile and run every given answer to that particaular question. Make sure you
    understand exactly WHY the wrong answers are wrong and why the correct answer is correct. Especially understanding why
    wrong answers are wrong will help you a lot during the exam. Also, try to find out what would be the implication if the
    wrong answer was right. Would it make sense? Would it cause a conflict?

    At some point during your study you should go even a step further and write your own exam questions. Try to make them in
    the same style as the actual exam questions. Then do not look at your questions for a while and try to answer them yourself
    or even post them for others (to receive feedback). I found that doing so really helps to get a better understanding of things
    which are not totally clear to you yet.