Is there a performance preference for doing a two-step toLowerCase and then equals? Why not just .equalsIgnoreCase()? (I suppose I could run a test... :) )
String.toCharArray(); (which is not static)
This allows things like:
String myString = "my String";
char[] myChars = myString.toCharArray();
or using the implicit String object:
char[] myChars = "my String".toCharArray();
What do you need the char[] for? (Not...
Why do I figure these things out only after I've posted?
The usefulness, apparently, is if a is declared as some parent type and you're unsure of which child it was actually instantiated to. Changing my example to:
Object a = new Date();
boolean b = (a instanceof String);
boolean c = (a...
I'm confused. Since (a instanceof b) won't even compile unless you have compatible types on both sides, what use is it? I mean, I already have to know that a is declared as type b or as a child of type b, so... what's the magic of having an operator tell me? And if it's only telling me...
I would think it would be conceptually clearer (and actually a bit easier to code) to use two StringTokenizers, one that uses "\r\n" for its token and creates full-line tokens, and then another that uses "\t " and breaks those lines into pieces. Then you'd have a clear...
Found it. In Java in a Nutshell, 4th ed., David Flanagan, O'Reilly & Assoc., Inc., page 97:
------------------------------------------------------------
Initializer blocks
...Java does allow us to write arbitrary code for the initialization of class fields... with a construct known as a...
O.K... I think I'm almost with you. So is there a static method on jdbc driver classes that is getting called when Class.forName() loads the driver? (I read somewhere that Class.forName() "initialises" the class. Does this mean it's looking for some static "init" method or...
I hope this isn't a total "newbie" question. I've searched everywhere (including here) and can't find a decent answer. I feel better that the Deitel Java book says that a discussion of Class.forName is "outside the scope of this book".
Here goes:
What does...
To gain some flexibility in Java and Swing, I've been playing around with creating a "PlayingCard" component and implementing some simple card games. PlayingCard extends JPanel and simply uses two JLabels to display a suit icon and a number. PlayingCard also catches mouseDragged...
Still snowed under, but it's slowly letting up. I thought it would end once the "break" (hahaha!) was over and students were back. WRONG. I will get to it eventually. :)
I've got ISA set up and have created a "Site and Content Rule" to Deny access to the web to a particular group of computers. It doesn't work. I've also tried to create a Shite and Content Rule to Deny access to the web for a particular user account. It also doesn't work.
What's...
Sorry... I'm in the throes of term-start preps (I teach and Direct IT at a local college) and haven't had a chance to put this into practice. It'll likely be the week of the 20th before things calm down enough for me to get to it. But it's in the back of my mind!
Thanks for posting this!
Oh, it's just a personal preference thing. IIS's ftp has extremely limited functionality compared to pretty much all other FTP servers. And having grown up in a UN*X world where FTP can do _anything_, it just annoys me. :)
You should have the uploads go to a temporary directory and then...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.