package zh.codegym.task.task04.task0407;
/*
宇宙中的猫
*/
public class Solution {
public static void main(String[] args) {
Cat cat1 = new Cat();
//在此编写你的代码
Cat cat2 = new Cat();
//在此编写你的代码
System.out.println("猫的计数为 " + Cat.count);
}
public static class Cat {
public static int count = 0;
public Cat(){
Cat.count +=1;
}
}
}
iamo
第 11 级
另一种解决思路,通过构造器
正在讨论
评论 (1)
- 受欢迎
- 新
- 旧
你必须先登录才能发表评论
Brandon Turner
24 十一月 2022, 18:44
This systexcall++ is dowloadung log soriteerpixleArt of AthicisCode matamic JovaSythixCodeaca Vs Ath45ComplerStoryGenraterFromCatsRFAmmginashion'instaryear'(exsampile)+_-_RF_-_pip_-_chip_-_sip_-_orcallununllnighaull+++styhbnigggoasquraia; 45 yarer 2014 Brandon Turner Hartselle alabama; Ninetailes Aritystort45;CovterAssimbely12 returonsythexjoVa5 encoderthycallnull++ endReturonzerothyexxxzes.
Brandon P'r'Sisessenessiess $400 for therouees onlassiion from TheCompterSincesMusiumInHusvileAlabama; E-gmail-34er.io.send 42q41w507 fail taxes pasintonStudintBPS ans ; payment to dotherthyesx Sinsces Awored of true Athiesic Cidung Of Coult Mahi GIC for 2023-24
0