Jump to content
Sign in to follow this  
Jedi

Apa Pendapat Korang?

Recommended Posts

class Lab2s1_2 {

public static void main(String[] args) {

SI_Masa m1, m2;

m1 = new SI_Masa();

m1.setMasa(3, 45);

m2=m1;

System.out.print("m1: ");

m1.pukulBerapa();

System.out.println();

System.out.print("m2: ");

m2.pukulBerapa();

System.out.println();

m2.setMasa(2, 15);

System.out.print("m1: ");

m1.pukulBerapa();

System.out.println();

System.out.print("m2: ");

m2.pukulBerapa();

System.out.println();

}

}

Bila run:

24782670dk5.jpg

Aku lemah sket bab programming ni, tu yang nak tanya ni.

Harap2 dijawab dengan sopan :blush:

Nape m1 berubah apabila nilai m2 disetkan kepada masa lain?

Edited by yusri

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...