Tuesday, August 9, 2011

Sentence Reverse

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Stack;
import java.util.regex.Matcher;
import java.lang.CharSequence;
import java.lang.StringBuffer;
public class Reverse {
public static void main(String[] args) {
String str = "Vijay is at Office";
ArrayList ab = new ArrayList();
char str1[] = str.toCharArray();
Stack se = new Stack();
for(int i=0;i if(str1[i]!=' '){
ab.add(String.valueOf(str1[i]));
System.out.println(ab);
}else{
String strr =null;
int a =0;
for(String gh:ab){
if(a==0){
strr =gh;
a=1;
}
else{
strr = strr+gh;
}

}
se.push(strr);
ab.clear();
}
if(i==str1.length-1){
String ghkk = null;
int j=0;
for(String gh1:ab){
if(j==0){
ghkk =gh1;
j=1;
}
else{
ghkk = ghkk+gh1;
}

}
se.push(ghkk);
ab.clear();
}
}
System.out.println(se.size());
for(int i=0;i System.out.print(se.pop()+ " ");
}


}
}

/* for(int i=0;i if(str1[i]!=' '){
result[j] = str1[i];
}
else{
String kl = null;
for(int k=0;k if(k==0){
kl=String.valueOf(result[k]);
}
else{
kl = kl +String.valueOf(result[k]);
}
}
System.out.println("KL"+kl);
s.push(String.valueOf(kl));
}
}
for(int i=0;i if(i==s.size()-1){
System.out.print(s.pop());
}else{
System.out.print(s.pop()+" ");
}
}
}*/









Tuesday, November 2, 2010

String

Pattern patt = Pattern.compile("^'(.*)'$"); // could be stored in a static final field.
Matcher matcher = patt.matcher(theString);
boolean matches = matcher.matches();
updateString = matcher.group(1);

updateString = theString.substring(1, theString.length() - 1);

Thursday, September 2, 2010

Java Performance Testing

http://www.artima.com/weblogs/viewpost.jsp?thread=122295

Monday, August 30, 2010

Checked Exceptions

http://cafe.elharo.com/java/voting-for-checked-exceptions/

Saturday, August 28, 2010

Weak references

http://www.ibm.com/developerworks/java/library/j-jtp11225/

Friday, August 27, 2010

Thread Safety-Spring

http://www.javalobby.org/articles/thread-safe/index.jsp

Wednesday, August 25, 2010

Java Interview questions

Java Interview Questions
--------------------------
1)Linked List vs Array List

2)Weak reference vs Strong Reference

3)Sort objects by Date

Ans:http://download.oracle.com/javase/tutorial/collections/interfaces/order.html
Ans:http://codingforums.com/showthread.php?t=43014

4)Abstract class vs Interface

5)Thread.join()

6)Ways to stop a Thread

7)Deadlocks

8)Avoid Deadlocks


Spring
--------

1)Different types of injection

2)Bean Context vs Application context

3)Why Spring

4)Spring with Hibernate with Struts







SQL
----
1)Delete vs Truncate
2)SQL Views
3)

Friday, July 9, 2010

Spring Dependency Injection

Spring Dependency Injection
http://www.vogella.de/articles/SpringDependencyInjection/article.html

Sunday, November 22, 2009

Cloning

http://www.javabeat.net/tips/34-using-the-prototype-pattern-to-clone-objects.html

Sunday, November 15, 2009

hashmap

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package corejava;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.TreeSet;
import java.lang.Thread;


/**
*
* @author VijaykumarRamalingam
*/
public class hasmap {
public static void main(String args[])
{
//Hashmap vs Hashtable
//Synschrnized
//null key and null values

HashMap s=new HashMap();
s.put("1","b");
s.put(null, "5");
TreeSet sd=(TreeSet)s.keySet();
Iterator i= sd.iterator();
System.out.print(s.get(null));
Hashtable s3=new Hashtable();
s3.put(1,"b");
s3.put(1, null);
System.out.print(s3.get(1));





}

}

reverse

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package corejava;
public class Main {
public static void main(String[] args) {
int a[]=new int[3];
a[0]=1;
a[1]=2;
a[2]=3;
int j=a.length-1;
for(;j>-1;j--)
{
System.out.println("j"+a[j]);
}
}
}

Saturday, November 14, 2009

UBS Interview Questions

1)oops concepts
2)Race condition
3)Deadlock'
4)critical section
5)String
6)Java access specifiers
7)final methods in object class
8)exception hierarchy
9)unchecked exception examples
10)program IO exception
11)f00()-overrriding
12)Collection interface implementation
13)methods of collection classes

Wednesday, November 11, 2009

Spring/Hibernate interview questions

http://www.mydeveloperconnection.com/html/spring-hibernate-QnA.htm

Monday, November 9, 2009

Hashed Collections

http://www.developer.com/java/other/article.php/10936_3799136_3/Java-Hashed-Collections.htm

Inner classes

http://www.developer.com/java/other/article.php/859381/SJCP-Exam-Preparation-Top-level-and-Inner-Classes.htm

http://www.developer.com/java/ent/article.php/899361/Some-Insight-Into-Inner-Classes-in-Java-Part-1.htm

Transaction Isolation Levels

http://docstore.mik.ua/orelly/java-ent/ebeans/ch08_03.htm

Tuesday, October 20, 2009

rap eCLIPSE

http://74.125.113.132/search?q=cache:svDuZQuz0lkJ:lomboz.ow2.org/eclipsist/2007/presentations/Jochen_Krause_Eclipse_RAP.pdf+eclipse+RAP]&cd=95&hl=en&ct=clnk&gl=us&client=firefox-a

Sunday, October 18, 2009

http://java.sun.com/products/jfc/tsc/articles/architecture/

Java Applet Tutorials

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

Pass by value

/* * To change this template, choose Tools Templates * and open the template in the editor. */
/** * * @author vramali1 */public class NewClass { private int i=0; private int j=0; public void bn(NewClass g) { System.out.println(g.i); System.out.println(g.j); g.i=45; g.j=56;
} public static void main(String args[]) { NewClass n=new NewClass(); n.i=1; n.bn(n); System.out.println(n.i); System.out.println(n.j); }}