To hash a string using SHA-256 in Java, you can use the MessageDigest class from the java.security package.
In Java, you can use the javax.crypto package to perform 256-bit AES (Advanced Encryption Standard) encryption.