« first day (2178 days earlier)      last day (2993 days later) » 

06:18
@ItachiUchiha Well, the servlet api, for a small example, is only in Java EE and we were specified to use JSPs/Servlets. Found out why im having trouble, I have IntelliJ community edition which doesnt work with Java EE. thankfully, im a student and can get the ultimate intelliJ for free. :)
 
2 hours later…
08:27
Hello java fans ...
08:40
Can someone please lend me a hand in understanding the difference between the toString @Override and an object[] in this code ...
@iain I don't understand the question
The two are nothing alike
Hello @MadaraUchiha, that would explain my difficulty in grasping the what is going on here.
I am asicaly trying to better understand how to display an arraylist full of a custom made class in a JTable. Struggling a little with the basic concepts I think ...
@iain @Override is an annotation, hinting the compiler that the following method should be overriding a method of the same name from the parent.
toString() is a method on the Object class, which all objects in Java inherit from, so that's why you use @Override
ok so that is why it is used to output to the terminal?
We want a string, I think I am being side tracked by the format, which is I think JSON, in my example?
@iain toString() is a method that's called by the Java engine whenever you try to treat an object as a string.
08:55
Yes, used for getting text from textfields and the like ...
oh
For example, System.out.println() accepts a String argument
yes
But in truth, any object can be passed, and its toString() method would be called\
The default toString() is kind of useless, it doesn't tell you anything about the object
But you can implement your own toString(), so that when it's printed (or otherwise used as a String instead of as an Object), it's human readable.
Nothing from the code you gave will print anything to the terminal, by the way.
08:57
We get the address if the toSting() override method is not used, in the override we output whichever data we wish from the class.
Ok, to the IDE terminal ...
is there a way to input the output from this :
Avion{avion=ANTONOV32, codeAvion=AN, vitesseCroisiere=560, rayonDaction=2500}
Into a JTable, or am I perhaps barking up the wrong tree here?
it has to be an object for the standard tablemodel?
I am getting the right output from the other loops but I am really trying to grasp the concepts more solidly.
Well, more solidly is not the best choice of words, I am trying to understand iterating ArrayLists of Objects to display data in JTables using the DefaultTableModel.
 
3 hours later…
12:18
@JohnnyCoder Haha. There you go :)
user6857832
13:10
@ItachiUchiha You told me that you'll post some link? :)
13:45
Morning, Java!
14:29
@Hemlata I don't have any preferences :)
Just use the search engines
user6857832
14:48
Well ok.
15:09
Hey all, working from home but haven't got VPN. My Maven is trying to connect to my companies repository, any way to stop it?
 
1 hour later…
user6857832
16:18
public class Foo {
public Foo() { ... }
public void Foo() { ... }
}
user6857832
Why do we use method as same name as constructor?
16:36
Its so the Java interpreter can recognize that it is a constructor when it turns it into bytecode. Likewise when the compiler reads the class files it will see the constructor bytecode and know that it needs to use that to initialise
user6857832
16:46
Is it often used in java?
Not just Java, all C languages do the same
user6857832
@kaleeway that means we use that for initializing?
user6857832
But what's the benefit for using it?
Yea, otherwise there is no way to create an object from your class with properties you want set during initialization
e.g. a database object with connection details
user6857832
That means it kinda work like constructor?
user6857832
16:50
But why do we use it? I mean we can use constructor instead or its used so we can change values both times. Like one using constructor and other using method as same name as constructor ?

« first day (2178 days earlier)      last day (2993 days later) »