Quote: "Constructors aren't methods"
Be that as it may, I still dislike the Java convention of methods starting with a lowercase.
Quote: "Java requires exactly one public class to exist in every .java file with the same name as the .java file. The reason for this can be traced back to how the jvm looks up names. Each .java file is compiled to a .class file, which in turn get packed into your .jar or whatever. If you wish to instantiate a class called Foo then the jvm will look for a Foo.class file and expect the class to be there.
"
I don't really see how that makes it any better. I never had any doubt there was some good reason for it. I still hate how the file name is used in the compilation process.
Quote: "Java does not compile all files in a folder automatically, that would be your build system (managed by your IDE I assume) that's doing this"
Hm... Well I'm not using any IDE. I'm writing them in N++ and compiling with javac.
In the directory, I have 4 .java files
Interface.java
MovieDatabase.java
Movie.java
Playlist.java
Calling
javac Interface.java creates a .class file for each of those .java files.
(The Interface class is the only class with a main() method. Interface does reference each of those classes, eg in the Interface constructor, it has the line MovieDatabse movieDB=new MovieDatabase(); )
I presume Java is preprocessing that, detecting it requires the class MovieDatabase, finding no such class file exists, and automatically compiling MovieDatabase.java.
This resulted in me spending a very long time trying to fix a few bugs. Of course I'm sure my Software Engineering lecturer mentioned this sometime. That moment when you wish you attended the lectures
That aside, I'll make the switch to a proper IDE. IntelliJ looks decent. The course requires that we use BlueJ for a few workshops which is annoying cos I don't like BlueJ lol
Quote: "statically typed "
I never said anything about Java being weakly typed. I said I can't stand weakly typed languages. I also don't like just how extreme the implicit conversion in Java is. Two separate headaches of mine
Quote: "123 + "haha" also works in DarkBASIC. It's an easy way to concatenate strings."
Sure it's easy, but I mean 123 is stored as a 4 byte integer in binary, "hahaha" is stored as a 6 dimensional character array with each value referring to the ascii table. Being able to add those is useful and easy, and also something I find very annoying because it makes no sense.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I had my maths exam. I was going absolutely fine until the last 2 questions. Then I had absolutely no idea how to do them, which sucks because together they count for 30% of the exam, and that exam counted for 25% of my final course grade.
I spend nearly 20 minutes trying to calculate the inverse function of f(x)=(x-1)/(2x-3). Then I finally remembered that you have to decompose the function to take the inverse. I never did get time to calculate the range and domain of f and f inverse though.
The other question involved calculating the complex roots of z^3=2root(2). Easy enough except you had to give the answer in Cartesian form and I couldn't work out how to calculate cos/sin of ((2root(2))^1/3) (no calculators were allowed).
We then had to plot the complex roots on a graph which was much easier. I just estimated the positions of the roots, but instead of giving their position in Cartesian form, I did it in polar form since the question did
not explicitly state that the graph points had to be given in Cartesian form. Hopefully the marker will see it the same way
Anyway I'm fairly confident I'll pass the exam since the rest of the questions were pretty easy, but doubt I'm gonna get that HD I wanted lol