Generating probability table of 2-character combinations from text file in Java
I have looked through your code. Here are a few things I notice


StringBuilder instead of using += on String, for more efficient string concatenation.


Creating a new instance of StringBuilder and using that would work better than using the + operator on Strings. Something like this:

StringBuilder builder = new StringBuilder();
// inside the loop call the following
builder.append("some string to append");
// ...
// later on when you need the string
builder.toString();


More descriptive variable names


Try to explain what your variable represents instead of just calling it wholeString. To you, you may very well remember the significance of each variable and what it represents, but this is a good coding practice to get into because code will be read more than written and it would be easier for anyone else reading your code to immediately tell what it's doing without having to in many cases even read comments. This is called "self-documenting code".


JDK 8+ Files API


After JDK 8 you can call lines() using the Files API. Although your approach is correct using BufferedReader and FileReader, you may want to consider switching to using the lines() method and operating on the Stream returned because it is a bit less verbose which makes reading it easier.


Succinct method chaining using Stream over iterative approach


If you switch to using Stream for the file, you can easily adopt a more functional approach of calling filter or other stream related functions on it. This is a bit cleaner to read than the iternative while loop to remove the newlines in my view.


Multiline comments using multiline comment syntax


For in-depth explanations and long comments that span to multiple lines, you can use the following notation:

/*

This comment 

spans

multiple lines

*/

However, with that being said - I think the comments in this code are a bit much. Using self documenting variables as mentioned above, comments can be lessened and the code would be more readable too.

Hope that helps, let me know if you have any questions on the feedback I've given.