@@JavaWithMala I get it that the overall theme is Darcula with the new UI, but what about the editor Color scheme? For sure it isn't Darcula with all those blue and grey tones 😅
Java is like a good written book - easy to fallow the story line and every paragraph is perfectly understandable. Unlike in Kotlin, with its unnecessary fight against the fake "code bloat" concept. If you hate "code bloat" learn Perl. Your code wouldn't be shorter then that. But most the time it would be easer to write a new code from scratch then understand what the old one is doing.
Guys, sorry, I see that you are trying to do a good job, mostly going over and beyond, but iterating over an Enumeration, or switch/case, that is not right, guys you are trying to teach will repeat antipatterns like these. :-( So to make it right: @AllArgsConstructor enum SingleUsePlastic { BOTTLE("Booth 4: Pick up a glass bottle"), SPOON("Pantry: Pick up a steel spoon"), CARRY_BAG("Booth 5: Pick up a cloth bag"), ; final String replacement; } String getReplacements(SingleUsePlastic plastic) { return plastic.replacement; } So the method above will be quite a duplicity itself. And if needed any sort of semantics, enumerations can always implement interfaces, the OOP approach could be like this: public class Sample { interface Arithmetic { int apply(int num1, int num2); } enum Operator implements Arithmetic { PLUS('+') { @Override public int apply(int n1, int n2) { return n1 + n2; } }, MINUS('-') { @Override public int apply(int n1, int n2) { return n1 - n2; } }, CROSS('*') { @Override public int apply(int n1, int n2) { return n1 * n2; } }, DIVIDE('/') { @Override public int apply(int n1, int n2) { return n1 / n2; } }, ; final char operator; Operator(char operator) { this.operator = operator; } } Operator getOperator(char c) { switch (c) { case '+': return PLUS; case '-': return MINUS; case '*': return CROSS; default: return DIVIDE; } } }
Thanks Mala, I like your teaching style.
Great Video! Easy to understand. Thank you very much.
10:13 If you place the camera view a little higher we can see the whole shortcut line.
I apologize for the overlook. I've noted it and won't repeat this mistake. Thanks for your feedback.
@@JavaWithMala Thank you for the videos.
Nice vídeo. Very helpful. If I can make a suggestion, please take sometime on The option selected before hit enter. It would let me check the option
Very helpful video indeed. Thank you.
Great stuff I learnt a lot in short time 🎉😊
Which theme are you using in this video? It is nice to look at for a video imo.
Darcula by JetBrains :-)
@@JavaWithMala ah really? For some reason it looks completely different on my machine 😅
@@Quillraven I'm also using the new UI in IntelliJ IDEA. I'm unsure if that explains the difference 🙂
@@JavaWithMala I get it that the overall theme is Darcula with the new UI, but what about the editor Color scheme? For sure it isn't Darcula with all those blue and grey tones 😅
great vid. thanks.
Great Video, even for Kotlin user,
or Just "switch" to Kotlin!😀😀😀
If Else, how many time have you written one? 😀 Always
Very useful
Title is confusing, i thought you will discuss about pattern matching or regular expressions in java😂😂
👋🏼🇨🇴🧔🏻👍🏼🤝🏻 Saludos desde Colombia.
Java is like baroque full of splendor i Preffer kotlin
Java is like a good written book - easy to fallow the story line and every paragraph is perfectly understandable. Unlike in Kotlin, with its unnecessary fight against the fake "code bloat" concept.
If you hate "code bloat" learn Perl. Your code wouldn't be shorter then that. But most the time it would be easer to write a new code from scratch then understand what the old one is doing.
@@RustedCroaker Living up to the name!
Guys, sorry, I see that you are trying to do a good job,
mostly going over and beyond, but iterating over an Enumeration,
or switch/case, that is not right, guys you are trying to teach
will repeat antipatterns like these. :-(
So to make it right:
@AllArgsConstructor
enum SingleUsePlastic {
BOTTLE("Booth 4: Pick up a glass bottle"),
SPOON("Pantry: Pick up a steel spoon"),
CARRY_BAG("Booth 5: Pick up a cloth bag"),
;
final String replacement;
}
String getReplacements(SingleUsePlastic plastic) {
return plastic.replacement;
}
So the method above will be quite a duplicity itself.
And if needed any sort of semantics, enumerations
can always implement interfaces, the OOP approach could be like this:
public class Sample {
interface Arithmetic {
int apply(int num1, int num2);
}
enum Operator implements Arithmetic {
PLUS('+') {
@Override
public int apply(int n1, int n2) {
return n1 + n2;
}
},
MINUS('-') {
@Override
public int apply(int n1, int n2) {
return n1 - n2;
}
},
CROSS('*') {
@Override
public int apply(int n1, int n2) {
return n1 * n2;
}
},
DIVIDE('/') {
@Override
public int apply(int n1, int n2) {
return n1 / n2;
}
},
;
final char operator;
Operator(char operator) {
this.operator = operator;
}
}
Operator getOperator(char c) {
switch (c) {
case '+':
return PLUS;
case '-':
return MINUS;
case '*':
return CROSS;
default:
return DIVIDE;
}
}
}