Shade
@ShadeVI
1
Hello guys,
I was making this exercise. Works well but i have a question.
Is there a way to run printInfo() of the Employee object only if HumanResou
Java
Coder100 Well yes, just remove the printInfo in Employee.java. Now, Employees won't be able to run the method, but HumanResources can.2 years ago
RYANTADIPARTHI i think so. Whatever utils you have gotten, you take that name and say .info('something'). like that. maybe that will work.2 years ago
1
Hi guys,
i'm new to Java, so i'm trying to understand a lot of stuff i've never heard before.
Please can you give me some feedback about this code? I
Java
SUHASTADIPARTH1 Looks awesome. Might want to try using more functions and classes instead of piling all the code in the main class....2 years ago
RYANTADIPARTHI looks pretty good. One thing though. Might not want to use so many prints for separating. Try this instead - \n2 years ago
2
Hi guys,
is there any difference between these two ways?
List wordlist = new ArrayList ();
and
ArrayList wordlist = new ArrayList ();
hellooneplus The main differences between List and ArrayList are given below List is an interface while ArrayList is a class.
List wordlist = new ArrayList ();
In the above line, we are assigning the ArrayList class object to the List interface.
There is a big plus on declaring them using the interface, which is what is known as "coding to an interface" instead of "coding to an implementation" which is a big Object-Oriented Design (OOD) principle.
1) Declaring them using an interface, means you can later1 year ago
Coder100 Difference
List is abstract, so you can change it's 'type'. ArrayList is not, but it will allow you more speed if you know all your types are going to be the same.
Which one to use?
I have always used ArrayList, and have never found any need for List.
https://java2blog.com/java-list-vs-arraylist/2 years ago
RYANTADIPARTHI Solution
the list in java is not dynamic, Meaning it can hold only a certain amount on information, based on what you put. So whatever value you want it to hold, that's all it can. While the array list is a dynamic. You don't have to specify anything. You can add how much you want. the internal process just makes more, and more space foryou to add unlimited.2 years ago
1
Hello guys, can you help me to understand this?
I have this example and in the second constructor Account the settler setBalance uses this.balance bu
Java
Coder100 this.balance is the one scoped to your class, but it can also be balance. Because in the second constructor balance is already an argument, you can no longer use balance to reference the property inside your class.
Did that make sense?2 years ago