import java.io.*; public class FileInputExample { public static void main(String[] args) { try { File inputFile = new File("input.txt"); FileInputStream fis = new FileInputStream(inputFile); int content; while ((content = fis.read()) != -1) { System.out.print((char) content); } fis.close(); } catch (IOException e) { e.printStackTrace(); } } }
public class ExponentialExample { public static void main(String[] args) { double x = 2.0; double result = Math.exp(x); System.out.println(result); } }This example calculates the exponential value of 2.0 using the Math.exp method and prints the result to the console. Package Library: Both examples are part of the Java Standard Library, which is included in all Java installations.