Madhu Madala

Greenhorn
+ Follow
since Jul 26, 2002
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 Madhu Madala

CONGRATS TRACY
I have passed my SCJP yesterday I am planning to take SCWD exam.AS Tracy mentioned about SCWD KIT AND Jwebplus.I will try to see what they are and where to find them.If i wont fidn them I will come back here to ask about them.
Once AGAIN Congrats!
19 years ago
Hi friends,
I have Passed SCJP2 yesterday,I have to say all credit goes to JAVARANCH Discussion guys.
Thanks to ALL.
19 years ago
You were right I am sorry i wanted to mention LineNumberReader lnr=new LineNumberReader(fr);
Thank you
19 years ago
Hi My question is Why does Line one doesnt compile.
Thanks in Advance
19 years ago
import java.io.*;
public class Io{
public static void main(String args[]){
FileReader fr= new FileReader("c:/Io.java");
InputStreamReader = new InputStreamReader(fr);//Line 1
LineNumberInputStream = new LineNumberInputStream(fr); Line 2
}
}

BOTH InputStreamReader and LineNumberInputStream has same type of constructor which takes InputStream type.
BUT Line 1 doesnt compile
Line 2 compiles.
19 years ago
Howard,
I saw answer some where in discussion forums
It is connection with assigning a value.
1.int i=0;
2.i=i++;
3.i=i++;
4.i=i++;
System.out.println(" int i = "+ i);
//prints out int i = 0
Because 0 will be assigned first to i
now in 2.again 0 is assigned to i and i is incremented.

Now you run this code
int i=0;
i++;
i++;
i++;
System.out.println("int I = " + i);
//The out put will be int I = 3
Thanks Dave,I got it.
From explaination can i conclude like this
1.Any final variable which can fit into another data type say byte is okie as long as value fits in at that time as it is final and compiler knows that it wont change further.
Sorry I didnt mention when you run the code 2 there will be compilation error,but for Code 1 it will compile and gives out put as 100
public class Test
{
public static void main(String args[])
{
final int i=100;
byte b=i;
System.out.println(b);
}
}
The output is 100.

Code 2:
public class Test
{
public static void main(String args[])
{
int i=100;
byte b=i;
System.out.println(b);
}
}
I am wondering why it gives out put in first case ie., code 1.