Mikael Jonasson

Ranch Hand
+ Follow
since May 16, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mikael Jonasson

Well, given the information in the assignment, this is just a snippet, so the code doesn't end there. That means that the text "HelloWorld" still has a reference to it. However, the "Hello", and the uppercase of "HelloWorld" does not (we're only printing the uppercase version, not changing any references. Remember: String is imutable).
/Mike
Are we talking database-tabels here?
Is it a insert or read you are trying to do?
The easiest way to get a null, is creating an sql-query, and just omitting the value that should be null, or setting it to null. That should be no problem as the sql-queries are strings.
As for representation in the program, I usually try to know the limit of the value used. Since it's a foreign key, it's linked to a primary key of some othar table. These keys usually start at 0 or 1, so by using a nullValue-operator on the select, you can convert the null value to a negative, fixed value, representing null inside your app.
/Mike
22 years ago
First of all: Are you sure you typed it in correctly?
ox sould probably be 0x.
Are U sure that the shifting of b and the declaration should be on the same row?
Why did you declare a?
Other than that, what happends is a left-shift of the value stored in b, bringin it to 0xfffffff;
That is what is printed.
//Mike
[This message has been edited by Mikael Jonasson (edited December 10, 2001).]
22 years ago
This is really a post for the beginner-forums, but sure I'll give you a few examples.
Polymorphism is "the art of changing", that is where sub-classes performs differently then their parents. The classical examples is how animals move differently:

You then create instances of dog and fish in the code above, but reference them using animal:

Then when you call your Move()-method in the different objects, Java keeps track of which instance it is and do what's needed.
Normal implementation for this is Print()-methods. Say you have a list of different items, all you need to do is call print in each to print it. Java and poylmorphism will keep of what to print, and how.
Did that help?
/Mike
22 years ago
Try s.charAt(0).
/Mike
22 years ago
Hi!
I'm currently working on an application connected to an oracle database. To speed up the connection to this database, I'd like to use the connectionpooling that's supposed to be part of the java 2-package. However, after reading through the documentation on this, I still can't figure out if the PooledConenction is the container for the connectionpool, or if the JDBC itself holds the connectionpool, and I should use the getPooledConnection() to get a connection, that I use once and then close.
Thankfull for a quick res�ponse, preferably with code-example(s).
/Mike
Congratulations. Well done.
However, there is anotyher forum for these kinds of posts...
/Mike
22 years ago
Try casting it.
/Mike
22 years ago
Well, opening the default email-sender sound like something you could do in html.
If all you want to do is send the mail, you could use the mail-API provided in J2EE...
/Mike
22 years ago
The only place you can call a constructor directly is inside another constructor (you can choose between another constructor in the same class, or one in a super-class). The only thing you can do outside a constructor, is create a new class (which will call the constructor, but YOU don't call it).
/Mike
By default there isn't a way (I think). But you could always write a static method that does this for your own classes.
/Mike
22 years ago
It depends on what YOU mean by casting. Casting is mearly the conversion of one reference-type to another. The advantage is that you get your program to work.
Look at the following example. Child extends super.

Did that enlighten you?
/Mike
22 years ago
Q2:
Borderlayout & Gridlayout doesn't let you specify the exact location, since the size of each windowpart has to do with the size of the window. I think GridBag does the same, but don't know enough about gridbag to know for sure.
Q3:
a) This depends on what they mean by "accessible". If they mean "can call methods in THAT particluar object", then the statement is true, since you need a reference to call the methods, thus both are referenced...
b) How is that even possible? See a)
d) Not sure. Don't really know about the finalize...
/Mike
I don't think notepad has support for page-break.
Otherwise, ascii 13 is Carrige Return(CR).
I think 10 is Linefeed and 12 is formfeed, or if it is the other way around.
As far as notpad is concerned, I thing you only need CR for it to work.
Doesn't the \n notation work in Java (I'm mainly used to C++). If so, that will work as new line.
/Mike
22 years ago
There is nothing wrong with the code per-se. However, by throwing and catching just Exception, you can't be sure that it is that error that occures. In this limited case: sure. But it is good to do things right from the beginning. The fanciest way is to create your own exceptionclass that inherits Exception, and catch that. I case something else occures it will be caught (hopefulle) further up in the program.
/Mike
22 years ago