andari3107

Class and Object

Nov 12th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1. public class LaptopSaya {
  2.     String merek,processor;
  3.     int ram;
  4.        
  5.     public static void main(String[] args) {
  6.         LaptopSaya s1 = new LaptopSaya();
  7.         LaptopSaya s2 = new LaptopSaya();
  8.         s1.merek = "Hp";
  9.         s1.processor = "icore3";
  10.         s2.ram = 8;
  11.        
  12.         System.out.println(s1.merek + " " + s1.processor);
  13.         System.out.println(s2.ram + " " + "gb");
  14.        
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment