Changes

Jump to navigation Jump to search
71 bytes added ,  10:29, 27 April 2022
m
Line 3: Line 3:  
===With apt===
 
===With apt===
 
  <nowiki>sudo apt-add-repository ppa:webupd8team/java
 
  <nowiki>sudo apt-add-repository ppa:webupd8team/java
                                  sudo apt-get update
+
                                    sudo apt-get update
                                  sudo apt-get install oracle-java8-installer</nowiki>
+
                                    sudo apt-get install oracle-java8-installer</nowiki>
    
Also ensure your JAVA_HOME variable has been set to:
 
Also ensure your JAVA_HOME variable has been set to:
Line 902: Line 902:     
public class HandlingExceptions {
 
public class HandlingExceptions {
 
+
    public static void main(String[] args) trows FileNotFoundException {
public static void main(String[] args) trows FileNotFoundException {
+
        File file = new File("test.txt");
+
        FileReader fr = new FileReader(file);
File file = new File("test.txt");
+
        throw new Exception("Example exception throwing");
+
    }
FileReader fr = new FileReader(file);
  −
}
  −
 
   
}</source>
 
}</source>
  

Navigation menu