sergAccount

Untitled

Feb 13th, 2021
455
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app11;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class Main2 {
  13.    
  14.     public static void main(String[] args) {
  15.         // try-with-resource
  16.         // 1)
  17.         MyResource res = new MyResource();
  18.         // 2)
  19.         try(MyResource res2 = new MyResource();
  20.                 MyResource res3 = new MyResource();){
  21.             System.out.println("do something with " + res2);
  22.         }catch(Exception exc){
  23.             exc.printStackTrace();
  24.         }        
  25.     }
  26. }
  27.  
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×