1 / 3

class Class0401

c. str. num. msg. Hello World!. class Class0401. class Class0402 { private String str; public int num;. public static void main(String args) { Class0402 c = new Class0402(“Hello World!”); c.message(); c.num = 250; int i = c.calculate(20);

merry
Download Presentation

class Class0401

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. c str num msg Hello World! class Class0401 class Class0402 { private String str; public int num; public static void main(String args) { Class0402 c = new Class0402(“Hello World!”); c.message(); c.num = 250; int i = c.calculate(20); System.out.println(i); } Class0402(String msg) { System.out.println(“オブジェクトが…”); str = msg; } コピー オブジェクト Class0402 オブジェクトが生成されました。 Class0402(String msg) { System.out.println(“オブジェクトが…”); str = msg; } Hello World!

  2. c str num class Class0401 class Class0402 { public static void main(String args) { Class0402 c = new Class0402(“Hello World!”); c.message(); c.num = 250; int i = c.calculate(20); System.out.println(i); } void message() { System.out.println(str); } オブジェクト Class0402 Hello World! 250 オブジェクトが生成されました。 void message() { System.out.println(str); } Hello World!

  3. c str num i n 20 class Class0401 class Class0402 { public static void main(String args) { Class0402 c = new Class0402(“Hello World!”); c.message(); c.num = 250; int i = c.calculate(20); System.out.println(i); } Int calculate(int n) { num += n; return num; } オブジェクト Class0402 Hello World! 270 270 250 オブジェクトが生成されました。 Hello World! Int calculate(int n) { num += n; return num; } 270

More Related