mnaufaldillah

MemberAccessTest Tugas 1

Oct 11th, 2020
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.  
  2. /**
  3.  * Write a description of class MemberAccessTest here.
  4.  *
  5.  * @author Muhammad Naufaldillah
  6.  * @version 10 October 2020
  7.  */
  8. public class MemberAccessTest
  9. {
  10.     public static void main( String[] args )
  11.     {
  12.         Time1 time = new Time1(); // create and initialize Time1 object
  13.        
  14.         time.hour = 7; // error: hour has private access in Time1
  15.         time.minute = 15; // error: minute has private access in Time1
  16.         time.second = 30; // error: second has private access in Time1
  17.     } // end main
  18. } // end class MemberAccessTest
  19.  
Add Comment
Please, Sign In to add comment