Larry Lai

Ranch Hand
+ Follow
since May 13, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Larry Lai

Hi everyone,

I've a homework execrise about that...

1. In what situation would we use an abstract class instead of an interface?

2. In what situation would we use an interface instead of an inheriting from a superclass?

3. When is it better to use an interface rather than an abstract class?

How to think that three kinds of keywords?
Thanks
Larry
22 years ago
Hi everyone,

I'm not sure what swap it is...
Here is an example code:


If anyone knows, tell me what it's going on...or give one more example for me learning...

Thanks a lot
Larry
22 years ago
Hi guys,
I've asked it before but my question is not very clear so I ask again...
I just want to know how to get started to learn JDBC,
Does anyone have some resource or source code about that ?

Thanks

Larry
Hi everyone,
Does anyone have a basic JDBC resource for study?
The resource is for connection, insert, delete query, update something like that

Thanks
Larry
Hi everyone,

Do you have any resource for learning 'Files and Streams'. I really can't get what the text book is talked.
Thanks...

Larry
22 years ago
Hey Barry,
Thanks a lot
I understand it now.
Larry
22 years ago
Hi everyone,
why this code has a "?"
radius= (circleRadius>=0.0? circleRadius:0.0);


Thanks

Larry
22 years ago
Hi everyone,
How're you ?

Do you know how to make the password in the JPasswordField getting the actionperform
then matching that "Javaranch" is the password
then if it's "Javaranch", log on.
Thanks..
Larry
22 years ago
Hi Ron,

the compiler replys about as below:


--------------------Configuration: JDK version 1.31 <Default>--------------------
C:\Documents and Settings\labuser\Desktop\FileInfo.java:11: unreported exception java.io.IOException; must be caught or declared to be thrown
if( !f.exists())f.createNewFile();
^
1 error
Process completed.

22 years ago
Hi Ron,
How're you ?
I mean the complier reply that the f.createFile( )
causes the problem.
I'm not sure what wrong it is...
Larry
22 years ago
Hi everyone,
This is the code as below:
f.createFile( )
the complier show that that is a bug

code:
--------------------------------------------------------------------------------
import java.io.*;public class FileInfo{public static void main(String args[]){// open (or create) fileFile f= new File ("readme.txt");if( !f.exists())f.createNewFile();// display file informationSystem.out.println("File Information");System.out.println("Name:" + f.getName());System.out.println("Path:"+ f.getAbsolutePath());System.out.println("Size:" + f.length()+ "bytes");if(f.canRead())System.out.println("File can read");if(f.canWrite())System.out.println("File can be written to");f.delete();}}
--------------------------------------------------------------------------------

Do you know what wrong it is?
thanks
Larry
22 years ago
Hi everyone,
This is the code as below:
f.createFile( )
the complier show that that is a bug


Do you know what wrong it is?
thanks
Larry
22 years ago
Hi everyone,
Why should exception-handling techniques not be used for conventional program control?
Thanks

Larry
22 years ago
Hi Dirk,

Thanks a lot what you have done.

Larry
22 years ago
Hi everyone,
How're you doing?
One basic knowledge I'm not familiar with is 'Passing Objects to a Method'
The sample code is as below:



It's from textbook and it's talked about Passing Object to a Method.
The main point that the author talks about is "copy the reference from obj" then, made it to the s...
I'm not sure what it is? Does anyone know about that ?

Thanks
Larry
22 years ago