File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Any suggestions please??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Any suggestions please???" Watch "Any suggestions please???" New topic

Any suggestions please???

Aaron Buch

Joined: Oct 23, 2000
Posts: 17
import java.awt.*;
public class testBean extends java.lang.Object
private int i;
public testBean()
public void settest(int i1) {
i1 = 3;
this.i = i1;

public int gettest() {
return this.i;
public static void main(String[] args) {
testBean t = new testBean();
The output was 0.
But i think it should be 3.
Any suggestions please???
Anna s Iyer

Joined: Aug 21, 2000
Posts: 24
You didn't call the settest() method!. Call it with a parameter and then only the instance variable i will get set to 3.
Hope that helps,
Anna S Iyer.
I agree. Here's the link:
subject: Any suggestions please???
It's not a secret anymore!