Where you go on the web is what makes a difference whether or not having either installed would have a negative effect on your system. By themselves, they're both harmless.
The data breach at Hacking Team exposed all kinds of previously unknown security flaws in all kinds of software. Criminals immediately took advantage of that wealth of information of the unpatched flaws.
Flash has been taking a beating for a long time, and Adobe now has to rush to fix the exposed flaws, on top of those that seem to be found every 2 - 4 weeks. It never has been a very secure plugin. But again, it depends on where you go on the web if you'd ever notice anything wrong. With this data breach, YouTube has banned Flash videos on their site. They've been in the process of translating all Flash video to MPEG4 for a while anyway, which allows all videos to play via HTML5. Which means users don't need any kind of plugin to view the videos on YouTube. This was just the final nail in the coffin for Flash as far as YouTube was concerned.
Java is another plugin that has a very long history of security problems. Oracle fixes one, only to have another pop up shortly afterwards. Again, it depends on where you go. But web site designers have been moving away from using Java for some time. It's actually getting somewhat difficult to find a site that requires Java in order to use the site properly. I use Java for a few apps on my drive I need that won't run without it, but have Java turned off for the web. I haven't used or come across a web site that required Java for over two years. If you have no need for Java for the web or local apps on your Mac, don't even bother to install it.