chandru.in
In the zone
Have you set the value of user within LoginAction class?
package com.desitek.cricket.action;
public class LoginAction {
private User user = new User();
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public String login() {
System.out.println(user.getUsername());
return "success";
}
}
class A { some code}
class B {some code A a = new A}
class C{
p s v main
{some code}
}
An object can be created anywhere, anytime from a class as long as its scope allows it to be. Have you not learnt OO concepts at school yet?Thanx for the screenshots, cleared the doubt like Harpic cleans the $hit from the flush.
In the first example u've created the object of A in constructor of B. Is it the only way or it can be done another way also?
In the first example u've created the object of A in constructor of B. Is it the only way or it can be done another way also?
OK, this is really n00bish compared to your standards, but still:
can anyone explain the "while","do while" functions (ie.loop) with an example? e-books arent helping here
[COLOR=SeaGreen][B]while(i < 2)[/B][/COLOR]
{
...
}
System.out.println("\nTesting the exit controlled loop\n");
int j = 0;
do
{
...
} [COLOR=Red][B]while (j == 100);[/B][/COLOR]
}
}
Thanks man. Really great explanation (although it took some time to understand use of words such as "boolean" etc. as they are not used commonly [I know what boolean means ] )I won't call it n00bish. Can be quite confusing even for seasoned programmer......................is the boolean condition, and the underlined words form the loop body.
*img155.imageshack.us/images/thpix.gif
[OFF TOPIC]
That CSV line can parsed easily using String.split(",") method.
I never meant to undermine your reply.Yes, I know that. Good that you mentioned so that anyone coming to this thread does not take it as an example for csv parsing (infact I've edited my original post to mention this). But in my case, that was a legacy code. Moreover, I just modded it and simplified it to serve as an example here. The actual code has lots of other things that a String.split would not have served anyways.
Chill never mind. Let's stick to our cup of Java.^^ Nopes. I did not say so either. What made you think that way? In fact, I appreciate you bringing it up.
No, its just that the doubt was too trivial. Why would I wanna doubt your programming knowledge? :\@QwertyM
If u r questioning my programming knowledge then I can tell u this that I've done Java 4 times in past 1 year but still ain't fully clear to me as possibilities are limitless in these Purely OOP languages. This thread is for asking questions, isn't it?