Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

anybody give me link to good source to read i/o streams

 
amit taneja
Ranch Hand
Posts: 813
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
answer the below questions and write the answer no. wiht them :-)


Q1

hii
can anybody give me link to good source to read i/o streams ?
I tried to read from books but its bit complicated and confusing...
and go above my head when to use particular stream in what situation ?
I understand 60% of streams but did'nt get clarity regarding when to use what like when to use bufferArrayinput stream and when to use Datainputstream.....
uuufff...



Q2

ok more question which is asked in my interview is that
is this static block is right


static
{
some code
}


or this is right ?

static abc:
{
some code;
}

I gave the answer that both r wrong as we can't call that particular block even using classname ? if it was funtion then we can call that

is i m right ?



Q 3

Ok another question that was asked is

say..
==========================================================

public class abc{
private static int a=10;
}
public class xyz{
public static void main(String args[])
{
System.out.println(abc.a);
}
}
==========================================================

I said it was not compiled as its declared as private ..it can't even be called by classname.variablename;

Q4
what is LinkedHashMap ?


Q5
why we override hashCode(); method in HashMap ? i mean why we write our won hashCode() method when there is default.. i read it from book but im not clear with the fundaa given there ?
so please tell me the detail reason...

Q6

there is sentence written
"One constructor can call another overloaded constructor of the same class by using this keyword" true/false ....answer was true but why ?
!!!. do we really do this ....we normaly use "super" for superclass constructor and "this" for current class constructor

=================================================================



Thanx and Regards,
Amit

don't mind i have put all question in one query......
thanx for co-operation...
:-)
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q1: See the I/O chapter of Bruce Eckel's Thinking in Java, http://www.faqs.org/docs/think_java/TIJ314.htm

Q2 & Q3: Did you attempt to compile these?

Q4: See the Java API for LinkedHashMap.

Q5: See the Java API for hashCode() in Object.

Q6: "this" has special meaning within constructors because if you were to call another constructor explicitly (by name), then you would create another object. See the "Initialization & Cleanup" chapter of Bruce Eckel's Thinking in Java (which also applies to your Q2), http://www.faqs.org/docs/think_java/TIJ306.htm
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic