Yes, Java is highly versatile and can be used for building both web and mobile applications. Java frameworks like Spring and JavaFX enable developers to create robust and feature-rich applications for various platforms.