Original Post
I am a C++ and MFC programmer. I love C++ and MFC!!!
Nonetheless, I have to take either Java or Visual Basic for a degree at my college. So, I decided to take Java for the summer.
Java is very, very easy. Java is weak!!! Furthermore, it is so similar to C++ that t seems like I am programming in C++ and using "Java Foundation Class" (a simile to Microsoft Foundation Class).
Anyways, I have two fundamental questions. First, in C++, you can declare a function "const" indication it does not make any changes to a member variable. Java as has const. I tried using const for function declaration the same way as I do in C++; however, it did not work. How do you declare a function as constant in Java?
Also, how do you declare a variable as constant in Java?
Lastly, in C++, you can give default values to function paramenters. For example:
-----
class CPlusPLusRules
{
public:
void GetExample(int nValue = 0, double nSpeed = 1.2);
}
-----
I tried that techinque in Java; however, it did not work. Is there a way to declare a function similar to the C++ example above in Java?
Thanks,
Kuphryn