Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.javarush.test.level06.lesson08.task01;
- /* Класс Cat и статическая переменная catCount
- Создать статическую переменную int catCount в классе Cat. Создай конструктор [public Cat()], в котором увеличивай данную переменную на 1.
- */
- public class Cat
- {
- static int catCount;
- public Cat(){
- Cat.catCount++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement