Dara Sitaramayya

Greenhorn
+ Follow
since Feb 26, 2008
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 Dara Sitaramayya

Hi,
"this" is current object of class.

Regards,
D.Sitaramayya.
1 public class FloatTest {
2public static void main(String[] args) {
3int i = 1234567890;
4
5float f = i;
6
7int x = (int)f;
8
9System.out.println(i == x); //false
10System.out.println("i........."+i+";x........"+x);
11}
12
13 }

x and f are not same. o/p of 10th line :i.........1234567890; x........1234567936
1 public class CardBoard {
2Short story = 5;
3
4CardBoard go(CardBoard cb) {
5cb = null;
6return cb;
7}
8
9public static void main(String[] args) {
10CardBoard c1 = new CardBoard();
11CardBoard c2 = new CardBoard();
12CardBoard c3 = c1.go(c2);
13c1 = null;
14//System.out.println("c1....."+c1.story);
15System.out.println("c2....."+c2.story);
16//System.out.println("c3....."+c3.story);
17}
18 }
In the above example,line 14 & line 16 are compilation errors.because both objects are null.That objects are eligible for GC.