Skip to content

Dead brain homewor k#2

Open
kostya23azaza wants to merge 3 commits intomasterfrom
DeadBrainHomeworK
Open

Dead brain homewor k#2
kostya23azaza wants to merge 3 commits intomasterfrom
DeadBrainHomeworK

Conversation

@kostya23azaza
Copy link
Owner

//ff

Copy link

@OKrylov OKrylov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В методе eat класса Cat кот внезапно голодает, если до этого он был уже сыт.
Лучше изменения такого состояния делать явно внешним вызовов соответствующего set метода
в остальном все отлично

System.out.println();
String test = "I like Java!!!";
System.out.println(test.replace("a","o"));
System.out.println(test.charAt(13));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

значения индексов лучше вычислять явно из самой строки

System.out.println(test.indexOf("Java"));
System.out.println(test.toLowerCase());
System.out.println(test.toUpperCase());//'kk
System.out.println(test.substring(7,11));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

значения индексов лучше вычислять явно из самой строки

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants