Pradeep Kumar

Ranch Hand
+ Follow
since Sep 11, 2007
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 Pradeep Kumar

Hello Ranchers,
I recently updated to Java 6.0 and also have good understanding on servlets and JSP to a good extent.In our earlier project we were using a framework built on struts 1.x. So i am quite familiar with that too. I have not much worked on the data layer side and client side technologies like javascript, Ajax, and also SQL, PLSQL, Stored proceedures,and frameworks spring. Now i want to seriously update my skills in all the layers like presentation, business and data layer. But my concern is there are thousands of frameworks, technologies, languages which is very difficult to learn all of them and even if we try there are so many updated versions that are coming that it becomes very difficult to keep up the pace in all directions. For ex, Struts 2 has already come in the market which has some major changes. Likewise I was using Ant in my earlie project but now people ask for Maven. Previosuly i read EJB 2.0 but with the new sppecification of EJB 3.0 JPA concept has been added. Should i read EJB 2.0 as most of the projects currently under enhancements or maintainance are using EJB 2.0 or i should update EJB 3.0 to be ahead in the market? should i be concentrating on and which frameworks and technologies i should be well versed with?? should i concentrate on one layer and devote my time entirely into that or i should know the basic advantages and dissadvantages of most of the frameworks used nowadays.Where should i be heading towards. I seriously need some guidance.

Thanks and Regards,
Pradeep
Hi Ranchers,
I am planning to learn ajax and in this regards, i am planning to purchase "Ajax in Action". But when i went to the shop they confused me that it was for the people from DotNet background. Is that true, because i glanced through the book and dint figure it out. But just wanted to confirm the same i am posting this. Also i have purchased "Javascript The Definitive guide" from orielly publication which covers Ajax too. But my question is shall i purchase Ajax in Action additionally.
Hello ranchers
Today i cleared SCJP 1.6 exam with 68%. I know the percentage is less but well i thought i would share it here as i was actively watching the topics posted here and was also asking a lot of doubts here. It took me 3 months of preparation for the exam even with 2 plus years experience on job. My next aim is to clear for web component exam. I studied using whizlabs training and the credit goes to them as well.

Cheers!!!
Pradeep
15 years ago
But how cum 6 gets printed. The string was "ab89ef". There is no index for 6
index0-a
1-b
2-8
3-9
4-e
5-f
But how 6 gets printed??
Hi Ranchers,
Please find the following code and let me know how exactly start and group work in this case and the output shows even 6.

code:
--------------------------------------------------------------------------------

import java.util.regex.*;
class Regex2 {
public static void main(String[] args) {
Pattern p = Pattern.compile("\\d*");
Matcher m = p.matcher("ab89ef");
boolean b = false;
while(b = m.find()) {
System.out.print(m.start() + m.group());
}
}
}

--------------------------------------------------------------------------------



In this code acording to me the index will start from
0-a
1-b
2-8
3-9
4-e
5-f
since we have * it means all are true for matching, but the output is
01289456. How is 6 in the output and how does the regex engine work to produce this output. Kindly explain the same.

Thanks and best Regards,
Pradeep
[ November 07, 2008: Message edited by: Pradeep Kumar ]
I agree to your point that if i have the default method as non private it will be overriden by the enum constant's method implementation. Perfect.

But i want to know that when is write Coffee.COLD.printPreferredCoffee(); statement, does the jvm call the method using the reference or the enum constant. I can demonstrate the inheritance thing that i mentioned.



Thanks and Regards,
Pradeep
15 years ago
Ok, got that private methods cannot be overriden. But why is the behavious differennt when we use inharitance. i.e, when we have a method declared as privarte in super class and the same in the subclass but with public access modifier we cannot use the superclass reference to call the method even though the object is of sub class. Also if we use the subclass reference the method implementation of the sub class will be called. But why is the similar behaviour not found when working with enum.My doubt is if the jvm treats enum as a constant(like Superclass reference) and try invoking the private method it should fail at compile time and if the jvm treats enum constant(like a subclass type reference) it should ivoke the constant specific method implementation right??

Thannks and Regards,
Pradeep
[ November 03, 2008: Message edited by: Pradeep Kumar ]
15 years ago
thanks for the answer.
15 years ago
Hi Ranchers,
I was working on enum and found this observation. When we have to override a general behaviour for a specific behaviour we override the default implementation with our implementation but the rules of overridng applies here that is if the generic method signature is public we cannot make the overriden implementation private. Agreed. But when i have a generic method declared to be private but i override this with public method my overriden method does not execute, instead the generic method gets executed. Kindly find the code snippet below for reference.



Thanks and Regards,
Pradeep
[ November 03, 2008: Message edited by: Pradeep Kumar ]
15 years ago
Hi ranchers,
When declaring an enum why is that we have to define the constructor only after defining the enum constants. If we try defining the constructor before the enum constants we get a compile time error. Can someone explain me this. For ex:
//Code that throws compile time error


// Code that works fine.


Thanks and Best Regards,
Pradeep
15 years ago
Hi,
How to enable or disable asserions at run time when we are working on server side technologies like servlets, jsp.

Thanks and Regards,
Pradeep
[ October 15, 2008: Message edited by: Bear Bibeault ]
15 years ago
Hi Micheal,
The intention behind proposing that the empty oder would not be a feasible solution was with repect to it would simply add one more panel just to have a space between the edge and the component which i think is not really necessary.
15 years ago
Thanks fo the reply. And what if i want to have some offset between my label component and the border of the panel so that the label does not stick to the edge of the panel. In this case the empty border would not be very much ideal. Can you kindly suggest me how to handle this case.
[ October 10, 2008: Message edited by: Pradeep Kumar ]
15 years ago
Hi ranchers,
I am new to swings but have experience on server side programming. I want to build a small swing application because i dont need J2EE foe s small application. I went through the API and worked on some layout managers. But i am not satisfied with the look and feel of the components on the JFrame. If someone can help me with this it will be of great value. The hicup that i faced is

1. My requirement is to have a panel inside a frame but it should be located at center and should have an offset gap with respect to the outer border of the frame. I tried with the borderlayout but when i add any component to the frame using borderlayout the component occupies the entire screen which is no what i want.



Thanks and Regards,
Pradeep

[ October 10, 2008: Message edited by: Pradeep Kumar ]
[ October 10, 2008: Message edited by: Pradeep Kumar ]
15 years ago
Hi ranchers,
Please find the below program and let me know why it throws StackOverFlowError.

class Program
{
Program program1 = new Program();
public static void main(String[] args)
{
Program program2 = new Program();
}
}

Thanks and Regards,
Pradeep
15 years ago