Advertisement
sergAccount

Untitled

Jul 17th, 2021
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  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.ex21;
  7.  
  8. /**
  9.  *
  10.  * @author student
  11.  */
  12. public class Main2 {
  13.    
  14.     public static void main(String[] args) {
  15.         // механизм исключений (основан на ООП)
  16.         // try catch throw throws finally        
  17.         String s = "AAA";
  18.         System.out.println("s.len=" + s.length());
  19.        
  20.         String s1 = null;
  21.         System.out.println("s1.len=" + s1.length());
  22.         System.out.println("OK!!!!!!!!!!!!!");
  23.        
  24.         //NullPointerException ne = null;
  25.     }    
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement