Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Win a copy of
Cloud Application Architecture Patterns: Designing, Building, and Modernizing for the Cloud
this week in the
Cloud/Virtualization
forum!
archu sweet
Ranch Hand
+ Follow
news
68
Posts
27
Threads
since Mar 07, 2011
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads
Recent posts by archu sweet
Garbage collection
@ jesper:
CardBoard c3 = c1.go(c2); i when this line is compiled go function is invoked which sets c2's value to null in go function...am i correct??
show more
14 years ago
Beginning Java
Garbage collection
c2=null
show more
14 years ago
Beginning Java
Garbage collection
class CardBoard { Short story = 5; CardBoard go(CardBoard cb) { cb = null; return cb; } public static void main(String[] args) { CardBoard c1 = new CardBoard(); CardBoard c2 = new CardBoard(); CardBoard c3 = c1.go(c2); c1 = null; // do Stuff } }
When // doStuff is reached,
I guess 3 objects are eligible for Garbage collection..C1,C2,C3...am i correct?? correct me if i'm wrong ??
show more
14 years ago
Beginning Java
Overriding
i think overriding of same functions is not possible in same class....am i correct??
show more
14 years ago
Beginning Java
Inheritance
yes i meant p0 == p1...i tried out it says it is valid....but they belong to different classes how can they be equal ??
show more
14 years ago
Beginning Java
Overriding
It is throwing this error : Exception in thread "main" java.lang.Error: Unresolved compilation problem
show more
14 years ago
Beginning Java
Overriding
public class A { public void doit() { System.out.println("hi"); } public void doit() { System.out.println("hsdsi"); } public double doit(int x) { return 1.0; } public static void main(String args[]) { System.out.println("hi"); } }
I just wanted to know what is wrong in the above code ?
show more
14 years ago
Beginning Java
Inheritance
class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB();
I want to know how come p0=p1 is true ??
show more
14 years ago
Beginning Java
Doubt regarding downcasting and upcasting
marc weber : Thanks a ton!!....I have understood...Your explanation is too good!!
show more
14 years ago
Beginning Java
Doubt regarding downcasting and upcasting
package Hi; public class Animal { public String noise() { return "peep"; } } public class Dog1 extends Animal { public String noise() { return "bark"; } } public class Cat5 extends Animal { public String noise() { return "meow"; } public static void main(String args[]) { Animal animal = new Dog1(); Cat5 cat = (Cat5)animal; System.out.println(cat.noise()); } }
I jus wanted to know what is wrong here which causes the compiler to throw Exception in thread "main" java.lang.ClassCastException: Hi.Dog1 cannot be cast to Hi.Cat5
at Hi.Cat5.main(Cat5.java:8)...error....Please help me out !!
show more
14 years ago
Beginning Java
Declaration of static members
i have jus another silly doubt ..
can we declare static a[0]=2; instead of static { a[0]=2; } ??
i'm not clear with the declarations...
show more
14 years ago
Beginning Java
Declaration of static members
Thnks guys ...
show more
14 years ago
Beginning Java