Ramnath krishnamurthi

Ranch Hand
+ Follow
since Jan 22, 2003
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 Ramnath krishnamurthi

Sameer,
Yup.You are right.s2 simply points to s1 and no new String object is getting created because of the assignment.
Thanks,
Ramnath

Feed an Opportunity.Startve a problem

Hi,
The below code creates 4 String objects


Correct me if am wrong.
Thanks,
Ramnath

Feed an Opportunity.Starve a Problem

Eusi,
I think i can give answers to some of your questions.
Yes,it is good to have J2ME knowledge because gone are the days when people were crazy about web technologies and now the techonlogy is going towards integration and mobile connectivity.I am pretty sure about this since am leading couple of projects for Sun and Verizon on the mobile enterprise connectivity.J2ME has excellent future and even Sun has come up with Mobile Application Builder tool to build mobile connectivity based applications.
Am not sure about the J2ME certification but J2ME is the path you can take if you want to stand above the rest of the crowd.
HTH,
Ramnath

Feed an opportunity.Starve a Problem

19 years ago
Eusi,
I think i can give answers to some of your questions.
Yes,it is good to have J2ME knowledge because gone are the days when people were crazy about web technologies and now the techonlogy is going towards integration and mobile connectivity.I am pretty sure about this since am leading couple of projects for Sun and Verizon on the mobile enterprise connectivity.J2ME has excellent future and even Sun has come up with Mobile Application Builder tool to build mobile connectivity based applications.
Am not sure about the J2ME certification but J2ME is the path you can take if you want to stand above the rest of the crowd.
HTH,
Ramnath

Feed an opportunity.Starve a Problem

Karthik,
You have made the right choice of buying K&B book.Try their mock exam and it is really good and also Dan's exam is supposed to be tough when compared to other exams.I have seen many mock exams simply cover topics which are not at all related to exam objectives.I heard from many people that if you can score 80+ in Dan's exam then you are quite good with ur prep.Inface am also preparing for SJCP and will be giving the exam sometime in May third week.JavaCertifcate.com mock is pretty easy so donot go with it since i donot score well in other mock exams even my score in javacertificate is 90%.More over,it all depends on how confident you are!!.All the best.
Thanks,
Ramnath
Hi,
I was going thro the Collection Frame Work and looks like except the legacy Stack class(which is a subclass of Vector),other implementations such as TreeSet and TreeMap support FIFO(First In First Out).Correct me if am wrong.
Thanks,
Ramnath

Feed an Opportunity.Starve a Problem

Karthik,
You are 100% right.
According to HashSet API definition
This class implements the Set interface, backed by a hash table (actually a HashMap instance). It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time. This class permits the null element
So Rashid if you really want to have elements in a sorted order use TreeSet which basically aligns your elements in an ascending order.
HTH,
Ramnath

Feed an Opportunity.Starve a Problem

Corey,
Thanks and your answer did bring some comfort
Thanks,
Ramnath

Feed an Opportunity and Starve a Problem

Hi,
Do we know to know all the methods available in the collection interfaces and the implementation classes?.They are too much to remember
Thanks,
Ramnath
I got the logic.
Since LinkedList implements List interface,add(int postn,Object obj) method will try to add at the desired postion.
So add("R") will add the object "R" at the 0th position.
add(2,"T") will obviously throw error since,it can be added at the 1st position and not the 2nd.
Hope my understanding is correct.
Ramnath
Hi,
What is wrong with the following code?

I am getting the following error

java.lang.IndexOutOfBoundsException: Index: 2, Size: 1
at java.util.LinkedList.entry(LinkedList.java:348)
at java.util.LinkedList.add(LinkedList.java:323)
at collections.LinkedListExample.main(LinkedListExample.java:20)
Exception in thread "main"


I was expecting that it should print A,R,T,Q
Thanks in advance,
Ramnath
Hi,
First of all if you look at the main method,no instance of abstract class is created
The next point is that the main method is a static one and there fore when you run the above code,it gets executed.
Change your code as per the following and you will get a compile time error
import java.io.*;
public abstract class test1
{
public static void main(String args[])
{
char c = 'a';
System.out.println("hello "+c);
test1 test = new test1();
}
public abstract void hello();
}

HTH,
Ramnath
Hi ,
How do i instantiate a static inner class?
The following code throws an exception
package innerclasses;
/**
* Title: Java Wanna Bee
* Description:
* Copyright: Copyright (c) 2004
* Company: Like Minds Consulting,Inc
* @author Ramnath Krishnamurthi
* @version 1.0
*/
public class StaticInner {
public StaticInner() {
}
static class myinner5{
public void methodA(){
}
}
public static void main(String[] args){
StaticInner test = new StaticInner();
StaticInner.myinner5 innertest = test.new myinner5();
//StaticInner.myinner5.methodA();
}
}
Exception:
"StaticInner.java": Error #: 479 : illegal qualifier; class innerclasses.StaticInner.myinner5 is not an inner class at line 22, column 47
"StaticInner.java": Error #: 308 : non-static method methodA() cannot be referenced from a static context at line 23, column 26
Any Help will be appreciated.
Thanks,
Ramnath

Feed an Opportunity.Starve a problem

Hi all,
How do we extend an abstract inner class?
I tried the following code
class TheOuter{
abstract class TheInner{
}
}
class TestInner extends TheOuter.TheInner{
public static void main(String[] args){
}
}
I am getting a compile time error that says

"TestInner.java": Error #: 478 : enclosing class innerclasses.TheOuter of class innerclasses.TheOuter.TheInner is not in scope


Any idea how to solve this?
If we cannot extend an innerclass,then what is the use of abstract inner classes?
Thanks in Advance
Ramnath

Feed an Opportunity.Starve a Problem

Hi all,
I came across this good article on how JVM implements synchronization behind the hood.
web page.
Hope this will help other certification aspirants like me.
Ramnath
Modified title to be more specific...
[ April 10, 2004: Message edited by: Barry Gaunt ]