Deepa sivasankar

Ranch Hand
+ Follow
since Jul 22, 2003
Merit badge: grant badges
For More
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 Deepa sivasankar

You can use the java disassembler and see the assembly instructions. But i am not sure for getting the source.
Great explanation... I feel the same.
Please correct me
When this is called,
Severn s = new Severn();

Severn() gets executed.
compiler implicitly calls the super class constrctor.
In Base(), amethod() calls the amethod() in Severn because it's calling the method of the current object referred by "this" ?
That's why Severn is getting printed instead of Base printed.
Can java experts clarify this for me?.

You can't create object of a static class. i.e you can't have an instance. For simplicity, let's take a static variable as an example.
public class example {
static int variable1 = 10;
In the memory it will retain its value till the end of the application. At some other point in code if you change
variable1 = 20;
then it will have a new value of 20 and it is retained. Moreover, you can access this variable example.variable1 and it doesn't need any instance.
Hope this helps..
I agree with you.
// System.out.println("Outer " + Outer.this.x);
The above syntax is useful if you have the same variable x within the inner class and you want to use the variable in the Outer class.
One small doubt. We can create an instance of the outer class from the inner class right.
From Sandra reply , quoted below.
"In your Summary, the second point should say,'local class in a static method cannot access outer class instance variables,since there is no this reference. So only static class variables
and final method variables."
We can access the instance variables of enclosing class through its instance.
Look at the code below.
public class Outer {
private int x = 5;
static int y = 6;
public static void main(String args[]) {
System.out.println("in main");
System.out.println("end of main");
static void method() {
class inner {
inner() {
System.out.println(new Outer().x);
new inner();
Produces the output
in main
end of main
Any comments.
Thanks Maha for a great explanation. I appreciate it.
Thanks ajith, again.
Can someone shed some light on this encoding part?. Please...
thanks for ur help
Can someone elaborate on this?please
Maha anna,
Can you please explain this objective ?
Distinguish between conditions under which platform default encoding conversion should be used and conditions under which a specific conversion should be used.
Can you tell me when you use the sockets what kind of encoding should be used?.
My answer is that we should use ascii 8 bit stream datatype and not character 16 bit unicoding.
I would appreciate your help.
Thanks ajith.
i have one more objective .
"Describe the permanent effects on the file system of constructing and using FileInputStream, FileOutputStream, and RandomAccessFile objects"
Can anyone explain or point me to the right place??
I found this in the sun objective. Can someone explain to me ?. I appreciate your help.
"Destinguish between conditions under which platform default encoding conversion should be used and conditions under which a specific conversion should be used. "
Please clarify this concept.
You cannot create use new keyword with an interface.
i.e ActionListener al = new ActionListener();
If that is the case , is this allowed if it is an anonymous inner class???. Is this a special case where it's allowed new with an interface.
But i agree the foll. statement as a valid one.
WindowListener wl = new WindowAdapter();
You can assign the reference to an interface of the newly created windowadapter object.
I would appreciate if maha can clarify this for us??