zhewen

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

Recent posts by zhewen

Hai rahul,
nice to see you hier again, for the first i want to say thank you that i have passed SCJP on the 1st, Aug.
this page you recommended here is also great, this is just what i search. do you have read the book from Jaworski? i need a certificat book, i have read the some capitals from Monson-Haefel.
i don't have patient, i think with a certifcat book would be go quickly and Aaron Robinson who has passed the part I has said the book design patterns and contracts is also not good... what is your opinion,looking forward for your reply
regds
zhewen
hi rahul, thank you so much, could you pl. also check the question that i posted today with file pathname etc..
zhewen
hi vivek,
do you know now, what is the correct answer?
regds
zhewen
hii all,
is this kind of question too easy, or too difficult? any reply pl.!!!
zhewen
hii all,
who can explain me pl. the following question, thanx in advance.
Regds
zhewen
Q1) Consider a directory structure like this (NT or 95)
C:\JAVA\12345.msg --FILE
\dir1\IO.class -- IO.class is under dir1
Consider the following code
import java.io.*;
public class IO {
public static void main(String args[]) {
File f = new File("..\\12345.msg");
try{
System.out.println(f.getCanonicalPath());
System.out.println(f.getAbsolutePath());
}catch(IOException e){
System.out.println(e);
}
}
}
What will be the output of running "java IO" from C:\java\dir1
a) C:\java\12345.msg
C:\java\dir1\..\12345.msg
b) C:\java\dir1\12345.msg
C:\java\dir1\..\12345.msg
c) C:\java\dir1\..\12345.msg
C:\java\dir1\..\12345.msg
----------------------------------------------------------

Q2). Suppose we copy IO.class from C:\java\dir1 to c:\java
What will be the output of running "java IO" from C:\java.
a) C:\java\12345.msg
C:\java\..\12345.msg
b) C:\12345.msg
C:\java\..\12345.msg
c) C:\java\..\12345.msg
C:\java\\..\12345.msg
24 years ago
hii all,
who can explain me the following question, thanx in advance.
Regds
zhewen
Q1) Consider a directory structure like this (NT or 95)
C:\JAVA\12345.msg --FILE
\dir1\IO.class -- IO.class is under dir1
Consider the following code
import java.io.*;
public class IO {
public static void main(String args[]) {
File f = new File("..\\12345.msg");
try{
System.out.println(f.getCanonicalPath());
System.out.println(f.getAbsolutePath());
}catch(IOException e){
System.out.println(e);
}
}
}
What will be the output of running "java IO" from C:\java\dir1
a) C:\java\12345.msg
C:\java\dir1\..\12345.msg
b) C:\java\dir1\12345.msg
C:\java\dir1\..\12345.msg
c) C:\java\dir1\..\12345.msg
C:\java\dir1\..\12345.msg
----------------------------------------------------------

Q2). Suppose we copy IO.class from C:\java\dir1 to c:\java
What will be the output of running "java IO" from C:\java.
a) C:\java\12345.msg
C:\java\..\12345.msg
b) C:\12345.msg
C:\java\..\12345.msg
c) C:\java\..\12345.msg
C:\java\\..\12345.msg
thanx Aru and DaB, it seems our server maschine go something wrong.
zhewen
thanx, AJ and Paul.
zhewen
24 years ago

hii all,
what does happen, wenn the compile says Invalid charactor in Input, and error more than 100?
here is an example:

import java.awt.*
public class grid extends Frame {
public static void main(String args []) {
grid g=new grid();}
grid() {
Panel p=new Panel();
p.setLayout(new GridLayout());
//for(int i=0; i<4; ++i)
p.add(new Button("hallo"));
add(p);
setSize(200,200);
show();
}
}
regds
zhewen
24 years ago
hi DaB,
thanx for the correction, but it doesn't work either, it displays: Invalid charactor in input and 360 errors?!
regds
zhewen
hii all,
why this programm doesn't compile?
class Base{
Base(int i){
System.out.println("base constructor");
}
Base(){this.(10);
}
}
public class Sup extends Base{
public static void main(String argv[]){
Sup s= new Sup();
// new Base(10);
}
Sup()
{
//super(10);
}
public void derived()
{
//Three
}
}
haiy all,
i have also run the programm, who can tell me why the sentence No. 2 is not used, i think the Frame is with a GridLayout(1,3),
and the Panel is with a GridLayout(2,1)?!

regds
zhewen
haiy gaurav,
i think a) should be correct, it has a File object as argument, c) is also correct why it has a Outputstream as argument, since ObjectOutputStream is a highlevel filter
and desto b) and d) are wrong. d) OutputStream is a abstract class, there is no Constractor for him. only a try.

regds
zhewen
i have just read your exam errta forum, who can tell me why Label does not generate any Events, i think Label is one of Component, it should generate at least KeyEvent, FocusEvent etc..., correct me please.

regds
zhewen
haiy,
i check the book, this is a static block sith brace, it don't need a ;. who kann help hier? please
zhewen