royce abraham

Greenhorn
+ Follow
since Oct 08, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by royce abraham

hi fordy
thank you very much for your information
royce
22 years ago
hi jyoti
some thing more interesting
class Base{int i =20;}
class Derived extends Base
{
Derived()
{
i=35;
int i = 30;
System.out.print(i);
}
public static void main(String args[])
{
Derived d = new Derived();
System.out.print(d.i);
}
}
answer 3035
observation: it allows a local variable to have the same name as the instance variable and recognises it without an error.
hello friends
is there any free website which gives space to host jsp/servlets pages.
thanks in advance
royce
22 years ago
hi jyoti ,
here is something more interesting add to your code..
class Base{int i =20;}
class Derived extends Base
{
Derived()
{
i=35;//new code added
int i = 30;
System.out.print(i);
}
public static void main(String args[])
{
Derived d = new Derived();
System.out.print(d.i);
}
}
answer is 30 35
But i am just wondering can I have a local variable with the same name as the instance variable ..
regards
royce
hello manish,
thanks for the information...
I am from mumbai and i have already registered for it..if you are also from mumbai..we can meet at the forum on 19th oct ,if you are also eager.
regards
royce
thank you bill,
i just forgot the basic(that default constructor are only when explicit constructors is not defined).
appreciate your fast response
royce
hello friends ,
i am a first timer in this forum...planning to give exam by next month end..
needs some help
import java.applet.Applet;
import java.awt.*;
public class Sample extends Applet
{
private String text="Hello World";
public Sample(String string)
{
text=string;
}
public void init()
{
add(new Label(text));
}
}
why is this code giving runtime error
and "applet not initialised and Sample can't be instantiated".
why doesn't the applet take the default constructor..
regards
royce