Saturday, 22 June 2013

Javapocalypse : What will happen to world without JAVA ??

Tuesday, 11 June 2013

UK Oracle Developer Day


Oracle Developer Day 2013

http://www.oracle.com/us/dm/h2fy11/180676-emeafm13047156mpp001c003-oem-1940507.html

Friday, 7 June 2013

One question by a user on Java pass by reference

Hi

Was just going through one of the blogs where there was confusion on pass by value and pass by reference, i found a interesting problem posted by one of the user.

I guess he wanted to interchange values of 2 Objects using a temp Object.

This was his program

http://javapapers.com/core-java/java-pass-by-value-and-pass-by-reference/

hello guys, i am above Anonymous
i hope this will help more for your confusion.
just a simple example
public class point
{
int x,y;
public void tricky(Point arg1, Point arg2)
{
arg1.x = 100;
arg1.y = 100;
Point temp = arg1;
arg1 = arg2;
arg2 = temp;
}
public static void main(String [] args)
{
Point pnt1 = new Point(0,0);
Point pnt2 = new Point(0,0);
line 1:System.out.println(“X: ” + pnt1.x + ” Y: ” +pnt1.y);
line 2:System.out.println(“X: ” + pnt2.x + ” Y: ” +pnt2.y);
System.out.println(” “);
tricky(pnt1,pnt2);
line 3:System.out.println(“X: ” + pnt1.x + ” Y:” + pnt1.y);
line 4:System.out.println(“X: ” + pnt2.x + ” Y: ” +pnt2.y);
}
}
just think there is a pass by reference in java. the output at line 4 will be 100 and 100 but it gives 0 and 0. so there is no pass by reference in java.

X: 0 Y: 0
X: 0 Y: 0

X: 100 Y: 100
X: 0 Y: 0



import java.awt.Point;

public class point {

    int x;
    int y;

    public static void tricky(Point arg1, Point arg2) {
        arg1.x = 100;
        arg1.y = 100;
        Point temp = arg1;
        arg1 = arg2;
        arg2 = temp;
    }

    public static void tricky1(Point arg1, Point arg2) {
        arg1.x = 100;
        arg1.y = 100;
        Point temp = new Point(arg1.x, arg1.y);
        System.out.println("temp :: X: "+ temp.x + " Y: " +temp.y);
        arg1.x = arg2.x;
        arg1.y = arg2.y;
        arg2.x = temp.x;
        arg2.y = temp.y;
    }

    public static void main(String [] args) {
        Point pnt1 = new Point(0,0);
        Point pnt2 = new Point(0,0);
        System.out.println("X: "+ pnt1.x + " Y: " +pnt1.y);
        System.out.println("X: "+ pnt2.x + " Y: " +pnt2.y);
        System.out.println(" The users wrong way of pass by reference");
        tricky(pnt1,pnt2);
        System.out.println("X: "+ pnt1.x + " Y: " +pnt1.y);
        System.out.println("X: "+ pnt2.x + " Y: " +pnt2.y);
        System.out.println(" My solution to the problem pass by reference");
        tricky1(pnt1,pnt2);
        System.out.println("X: "+ pnt1.x + " Y: " +pnt1.y);
        System.out.println("X: "+ pnt2.x + " Y: " +pnt2.y);
    }
}

> java point

X: 0 Y: 0
X: 0 Y: 0
 The users wrong way of pass by reference
X: 100 Y: 100
X: 0 Y: 0
 My solution to the problem pass by reference
temp :: X: 100 Y: 100
X: 0 Y: 0
X: 100 Y: 100

Sunday, 2 June 2013

Virtual Developer Day: Java

Virtual Developer Day: Java

Click on the image or link to register for Java Virtual Developer Day 2013



Join this FREE virtual event where you will learn about:
•    Improved developer productivity and HTML5 applications
•    What's new in Java that helps you begin programming on a wide range of embedded devices
•    Language improvements in Java SE to accelerate application development
Watch informative tutorials that you can repeat at your own pace to improve your Java programming expertise, as well as engage in live chat sessions with technical experts.
Americas/Canada - Wednesday June 19, 2013 
9:00 a.m. - 1:00 p.m. PDT / 12:00 p.m. - 4:00 p.m. EDT / 1:00 p.m. - 5:00 p.m. BRT
EMEA/Africa/Middle East - Tuesday June 25th, 2013 
9:00:00 a.m.  - 1:00pm BST / 10:00:00 a.m. -  2:00 p.m.CEST /
1:30:00 p.m.  - 5:30:00 p.m. IST / 12:00:00 p.m. - 4:00 p.m. MSK /
08:00:00 a.m.  - 12:00 p.m. Corresponding UTC (GMT)