Mihai T

Greenhorn
+ Follow
since Jun 25, 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 Mihai T

Hi,
Regarding your question about write method of FileOutputStream I'm not so sure I understand what you're asking.
About private methods: private methods are visible only in the class in which they are defined. That is why a private method can not be overriden. So if you define a new method with the same signature in a subclass, which is legal, you do not override anything.

Hi,

A File object is an abstract representation of file or directory pathnames. If the file/directory doesn't exist il will not be created when you create the File object.
If you try to create a FileInputStream using a File object which represents an inexistent file you will get and FileNotFoundException - because you try to open an inexistent file.
If you try to create a FileOutputStream using the same File object, the file will be created !!
I think it is quite intuitive:
- when you try to read from a file, the file must exist.
- when you want to write something to a file you have to create the file.
Hope it helps...
Hi,

Please read more carefully. At page 25 it is said that character 1 may be represented by '1' or unicode '\u0031'. At page 59 it is a comparison between primitive value 1 and character 1 !!! Character '1' is converted to an int before test (binary numeric promotion) which gives 0x31 or 49 decimal which of course is != 1 !!!
Mihai T.
Hi,
You are right: the expression could be evaluated to 3 or 4. The answer b (i.e. 3) is wrong.
Try this two or three times:

public class Z {
public static void main(String[] args) {
int j = 0;
for (int i = 0; i < 10000;i++) {
j = (int)Math.round(Math.random() + 2.50001);
if (j != 3) System.out.println("i = " + i + " j = " + j);
}
}
}

Mihai T.

[This message has been edited by Mihai T (edited June 25, 2001).]