salman baig

+ Follow
since Mar 26, 2001
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by salman baig

congrats dear .............
hope u have enjoed it. many many congartulations...
mujay pata hay keh ti=um nain SCCJP karnain kay liay
"Din Raat Aik Kar Dya Tha". u worked hard. u deserve it.
many many congratulations again.
21 years ago
/********plz observe this***************/
class abc{
void method()
System.out.println("method in base class");
class xyz extends def
public static void main(String args[])
xyz ob=new xyz();
void method()
System.out.println("method in derived class");
here the output is
"method in derived class"
although the method is called from base class constructor
but the ovveridden version of method is called.
plz help me.
thanx in advznce
i am facing problems in understanding the behaviour
of static object created at class level.
so any body can plz help me out
thanx in advance
so different answers from different people.
can any body else make this point clear to me.
here is some code plz observe it
1. class abc
2. {
3. static int a=10;
4. static abc ob=new abc();//static object instantiation
5. public static void main(String args[])
6. {
7. ob.method();
8. }
9. public void method()
10. {
11. ob=new abc();// compiles and run
12. System.out.println(" a = "+a);// direct refence error
13. System.out.println(" a = "+ob.a);// with object still error
14. }
15. }
as java says that static members can't be refenced by non-static
methods. so why static objects as in line (10)are accessed by non-static static variable is not at line (12,13),wheteher called directly or with the refence of object.
so i can't understand this behaviour of static.
can any body explain.
thanx in advance.
hello ,
every body
i want to ask a question about java.lang andjava.util package
that how much understanding of these packages is required
am i supposed to know each and every class and method of these packages?
plz clear this thing to me.
thanx in advance