didn't get access to public variables of a class through its object

am using IBM RSA for jsp programming ..i have created two classes inside the same package and then tried to create an instance of one classs in another.like student obj=new student(); its working..but cant access the var inside studentlike obj. wil not show nything
[293 byte] By [prabhath_ma] at [2007-10-3 6:40:32]
# 1

To be honest: your question sounds like you should neither use RSA nor JSPs yet. Please review your basics first.

And simply because your IDE's code completion doesn't work, it doesn't mean you don't have access to public instance attributs (as opposed to class/static attributes), which usually shouldn't exist anyway.

The compiler is the only instance to tell you whether access is possible or not.

CeciNEstPasUnProgrammeura at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 2
that's right...am new to this rsa and jsp...i was using .net and there we can create objects of a class like wat i said earlier.i f they belongs to different namespaces we hav to simply use the using namespace ...can u plz tell me a remedy for the current problem
prabhath_ma at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 3
> can u plz tell me a remedy for the current problemI don't even know what your problem is. As long as there is no error message, there is no error. RSA's code completion is not the Java compiler...Please post the relevant code.
CeciNEstPasUnProgrammeura at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 4
all variables should be private anyway
mchan0a at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 5

i wil explain u wats the problem

i have created a project test1

and then a class ClsStudent and while creating that i hv given center as the package name..OK

this is Clsstudent

public class ClsStudent

{

public int a;

}

i am having another class like ClsProcess in the same package(center)

within that

public class ClsProcess

{

ClsStudent obj=new ClsStudent();

obj.here am not getting that obj.a..see a is a public variable..then why am not getting that a there...

that is my doubt

and see am not a jsp expert.. am a fresher in this field and now working in .NET Platform...

i was just trying this RSA

}

prabhath_ma at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 6
Once more, you only don't get it because you hope for the code completion to do your thinking. There is no reason why you couldn't access a if you tried.
CeciNEstPasUnProgrammeura at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 7
i have tried that build project...if it's not that code completion u mean then plz let me know wat is that code completion.think am not disturbing you...
prabhath_ma at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 8

> i have tried that build project...if it's not that

> code completion u mean then plz let me know wat is

> that code completion.

You keep talking about "you don't get a if you type obj.".Getting the suggestion for an a is what's called code completion.

I take it back, it's not the code completion. You get an error because your putting some statement that's not a declaration outside any method.

CeciNEstPasUnProgrammeura at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 9
I have changed the status of websphere and run a simple login.jsp page(it doesnot contain any programming just two text boxes and one submit butten.if u get wats my problem then let me know how to solve that...expecting your reply....... .prabhath
prabhath_ma at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 10
i think i get something ...OK OK its really my fault...yaa i accept it..thanks for your kind reply's...i wil be back with more doubts
prabhath_ma at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 11

> I have changed the status of websphere and run a

> simple login.jsp page(it doesnot contain any

> programming just two text boxes and one submit

> butten.

It has nothing to do with JSPs, RSA, Websfear or anything else.

> if u get wats my problem then let me know how to

> solve that...

You can't put non-declarations outside any methods or initializers. whatever statement "obj.a" is supposed to become, it's illegal syntax. The simple solution is: don't do it.

Your real problem is a lack of basic Java knowledge, I'm afraid. You should gain some experience before even considering moving to JSP.

CeciNEstPasUnProgrammeura at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...
# 12
> thanks for your kind reply's...I doubt mine are kind, but they do contain usable information. :)> i wil be back with more doubtsSee you then.
CeciNEstPasUnProgrammeura at 2007-7-15 1:29:26 > top of Java-index,Java Essentials,Java Programming...