Keith Lockey

Greenhorn
+ Follow
since Jan 18, 2003
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 Keith Lockey

I don't understand how a public class like TextComponent (that is not abstract and not an interface) is not instantiable?
Don't understand the purpose of this as well??
Thanks,
Keith
20 years ago
my class path is correct, Class.forName("com.mysql.jdbc.Driver").newInstance();
is working properly.
Thanks,
I have the question mark in my code and it still doesnt work. I have also tried conn=DriverManager.getConnection(url,user,passwd);
That doesn't work either.
Thanks for the help.
Keith
When I try to use the DriverManager, i get "Driver not found for URL: "
Not sure what to do at this point.
driver.acceptsURL is false, why? I can't get it to connect.
Thanks,
Keith

[ July 22, 2003: Message edited by: Keith Lockey ]
[ July 22, 2003: Message edited by: Keith Lockey ]

don't understand the purpose of class variable shadowing?? What other types of shadowing are there. Can there be methods shadowing as well??
20 years ago

would print 1


would give exception "java.lang.NullPointerException
at practice.FakeSystem.main(FakeSystem.java:19)
Exception in thread "main" "

Question: How is FakeSystem.out.nonStaticMethod() different from System.out.println()???
Why is println() non static in the static out.
21 years ago
from jdk1.4 source --- code declared in the System class

just trying to figure out this code?
21 years ago
I was able to change my name this time to real name.
Sorry about the confusion
21 years ago
so println() is static in System.out.println() even though I can't find it declared static in the Java 1.4 api.
Where do I find it?
21 years ago
Thanks, I think it is becoming clearer.
21 years ago
but if i used the out in main I could still call the out.nonStaticMethod() and it would return 2,
would this work?

output: 2
I think Sun has made an error about this. Please see the paragraph at the link I have below.
Thanks,
Keith
----------------------------------------------
class ExampleProgram {
public static void main(String[] args){
System.out.println("I'm a Simple Program");
}
}

"The static fields and methods of a class can be called by another program without creating an instance of the class. So, just as the Java VM interpreter command could call the static main method in the ExampleProgram class without creating an instance of the ExampleProgram class, the ExampleProgram class can call the static println method in the System class, without creating an instance of the System class. "
from
http://developer.java.sun.com/developer/onlineTraining/Programming/BasicJava1/prog.html
21 years ago
so when a class, object or class is static and referred to in a program, it can use any of the methods within it whether or not they are static.
21 years ago