When the only tool you have is a hammer every problem resembles a nail. When the problem is about breaking things, most probably the hammers will be useful and gets the job done easily. But some problems are better done using other tools, for example cleaning a toilet bowl? is it done better with a hammer or a brush? No need to state the obvious right?
Same with programming languages, you study the problem more, what are you trying to achieve? what possible sub problems do i have solve? is X programming language better than Y programming language when solving this problem? Is it practical to use 10 programming languages just because i have 10 problems in different domains and these problems are better coded using a programming language that specializes on those domains? or should i use 1 language that will be able to solve them all, though it may not be the best way to solve them, but the solution is not so difficult and I do not gain a lot from using those languages?
The problem domain expertise is just one parameter in choosing a specific language to use when solving a problem.
There is also the parameter about profitability/income generation which programming language will pay you a lot of money when you work.
At the end of the day, It is your problem solving skills that matter, that is what programming is all about and programming language is just your tool to solve your problem.
So C++ or Java?