Java Quiz no2

Τι θα τυπώσει ο παρακάτω κώδικας?

-SmallBean{a=5, b=500}
-SmallBean{a=1, b=3}
-RunTime Exception
-Δεν θα κάνει compile

Αιτιολογήστε το στα σχόλια

 


[code language=”java”]
package javaapplication1;

/**
*
* @author TENANTS\diakogiannisa
*/
public class JavaApplication1 {

SmallBean playWithThoseNumbers(final Long a, final Long b, final SmallBean sb) {
sb.setA(a);
sb.setB(b);
return sb;
}

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Long a = 1l;
Long b = 3l;

JavaApplication1 ja = new JavaApplication1();
SmallBean inputData = new SmallBean(50l, 500l);
SmallBean sb = ja.playWithThoseNumbers(a, b, inputData);

System.out.println(sb);

}

}

class SmallBean {

public SmallBean(Long a, Long b) {
this.a = a;
this.b = b;
}

public SmallBean() {
}

private Long a;
private Long b;

public Long getA() {
return a;
}

public void setA(Long a) {
this.a = a;
}

public Long getB() {
return b;
}

public void setB(Long b) {
this.b = b;
}

@Override
public String toString() {
return "SmallBean{" + "a=" + a + ", b=" + b + ‘}’;
}

}

[/code]

Passionate Archer, Runner, Linux lover and JAVA Geek! That's about everything! He has worked for many years as an Software Architect designing and developing enterprize projects, e-banking and high availability portals with extensive experience in the public, european and private sectors. Having speaker in several confrences he never misses opportunities to interact with the OSS community. In his leisure time he either runs or shoots a lot of arrows!