Mohan Ramanna

Ranch Hand
+ Follow
since Jun 26, 2000
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 Mohan Ramanna

thanks a lot Lakshmi,
I got the concept it is very clear now.I tird the code also.
But i would like to ask u where do we find this singleton class to be useful.
Thanks a lot.
bye
regards
-mohan
hello friends,
I know that a singleton class is one which can have only one
instance.
I wanted to know how to make a class singleton.
thanks in advance
bye bye
-regards
mohan
class Chartype{
public static void main(String argv[] )
{
Chartype c = new Chartype();
String s = new String("ello");
c.amethod(s);
}
public void amethod(String s)
{
char c='H';
//c = c + s;
s = c + s;
System.out.println(c);
System.out.println(s);
}
}
sudhakar the code if not commented gives the error cannot
convert char to java.lang.string if commented gives output H
and Hello on executed.
23 years ago
james kid
hi james congrats and thanks for u r valuable suggestion.
any how best of luck for u r future.
regards
- mohan

mita
and equals() or == returns true are false when used inside
and expression only.
like if(s1.equls(s2)) or if(s1==s2) like wise.
regards
- mohan
hello,
Why cnnot i have a public class or public static void main
inside a package why does it give error.
The code below is for reference.
package hello;

class pack1 {
void show()
{
System.out.println("Hello pack1");
}
}

class subpack1 extends pack1 {
void show()
{
System.out.println("Hello subpack1");
}
}

class diffpack {
void show()
{

System.out.println("Hello pack1");
}
}
class xyz {
public static void main(String args[])
{
pack1 a = new subpack1();
a.show();
diffpack b = new diffpack();
b.show();
}
}

- thanks in Advance

regards
- mohan
can somebody give a clear picture about the two with
examples.
- Thanks in Advance

regards
- mohan
The answer is "c" correct because
capacity increment+initial increment= total size of the vector
hence 5+10=15
so when overflows its capacity is 15.
I think it is clear
- regards
mohan
Thanks Ankur
- It is clear now infact it is a simple and exact example.

regards
- mohan
hello Deeksha,
what u have given explanation is exactly correct and no
confusion in it.
But i want a case where | and | | behave differently.
please send answer in deatil.
thanks in advance
regards
-mohan
IN the below code
String s = null;

if(s != null | s.length()>0)
if(s != null | | s.length()>0)
both throw IOexception then what is the difference
in them.
clearly explain with example.
- thanks in advance
-mohan
can someone throw liht on the join () method of thread.
a clear explanation is expected?
thanks in advance
- mohan
I have read that java objects are stored on the Heap in
the memory can i get a list of reference where
java objects, variables,static,final variables etc, primitive
objects are stored.
A detailed explanation of the above is expected?
Thanks in advance
- MOhan
hello
- The key point to understand here is that
Base b= new Derived();
makes us b an object of class Derived which extends the
base class. Hence a method like b.show() will always call
the respective method in the parent class.
while the variable b.x references to the type i.e hence
calls the derived class.
I think it is clear now.
bye
-mohan
Jason
I think the code doesnot compile i.e it gives compile
time error.
In line 2 the trermination is missing ; and if it
all u teminate it gives compile time error as
wrong no of arguments for that method.
check out in the java documentation for right number of
arguments.