Miscellaneous I
0 file(s) 0 bytes
3 dir(s) 16,252.02 MB free
c:\>PATH
PATH=c:\java\bin;c:\tools;c:\windows;c:\windows\command
c:\>ren jdk1.2.2 java
If I wanted to switch to JDK 1.3.0, I simply do:
c:\>ren java jdk1.2.2
c:\>ren jdk1.3.0 java
and voila! new JVM. The drawback here is you need to know what the current one is,
but that s simple using java  version or by process of elimination.
  
Joseph A. Millar
 Q: I would like to know if it could be considered as dangerous to change directly
the content of a bytecode.
Perhaps you ll think the question is strange... In my case, I m just trying to replace the
content of a known string by another string of the same length.
I  ve already tried and it seems to work properly, but I m not sure that it could be OK
with different (all) JVM or for example, if the content of the bytecode could controlled
by a checksum or something.
on JVM there s nothing about these kind of control.
Answer: Depends on your definition of "dangerous." If you mean "error prone", then I
would answer with a definite yes, especially if you are modifying the code itself... you
need to be aware of all the jump targets so you can update them as necessary, and
understand enough about the verifier that you can write provably safe code;
otherwise a verifier will reject the class file. 
However, a properly written resulting class file is perfectly valid and portable; that s
the meaning of Java s much hyped "binary compatibility".
There are also no checksums to worry about.
  
Chris Smith
 Q: what is the difference between "C:\\" and "C:\\." ?
In the following codes. can anyone explain this ?
File dir = new File("C:\\" );
String [ ] files = dir .list();
File dir = new File("C:\\." );
String[] files = dir.list();
Answer: "." is used to refer to the current directory. For example, using the change
directory command "cd ." changes you to the current directory, effectively doing
nothing. "c:\\.\Files\image.jpg" is exactly the same as saying
"c:\\Files\image.jpg"
The code you gave should do exactly the same thing in both forms, to my mind  
return a list of the files in the root of the c:\ partition.
file:///F|/a_jsite/350_tips/miscellaneous I.htm (9 of 10) [2001 07 08 11:24:56]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved