Monday, December 21, 2009

Reflection in java

  • This API helps to inspect classes, interfaces, field and methods at runtime.
  • It is java API- Reflection
#we can use it for

  • Analyze the capabilities of classes at runtime;
  • Inspect objects at runtime, for example, to write a single toString method that works for all classes;
  • Implement generic array manipulation code; and
  • Take advantage of Method objects that work just like function pointers in languages such as C++.
#Some basics
  • Class class
  • Class c1=e.getClass(); if e is an object of type Employee
  • Date d = new Date(); Class cl = d.getClass(); //It will results java.util.Date
  • e.getClass().newInstance(); helps to create new instance of type Employee
#Using Reflection to Analyze the Capabilities of Classes
  • The three classes Field, Method, and Constructor in the java.lang.reflect package describe the fields, methods, and constructors of a class.
  • all three classes have getName() method will return name of the item,
  • Filed-> getType() will return the type of the filed.
  • there have methods for Method class to get the number of modifiers, return type and modifiers
  • for constructor-> getModifiers(), getDeclaringClass() are among them
# Using Reflection to Analyze Objects at Runtime
  • Employee harry = new Employee("Harry Hacker", 35000, 10, 1, 1989);
Class cl = harry.getClass();
// the class object representing Employee
Field f = cl.getDeclaredField("name");
// the name field of the Employee class
Object v = f.get(harry);
// the value of the name field of the harry object
// i.e., the String object "Harry Hacker"
  • f.setAccessible(true); //if the field is private w can access by calling this.
Share your thoughts

Tuesday, December 15, 2009

Big telecom company: Java/ J2ee interview 12/ Dec/ 2009

# The following lists the interview questions from a big telecom company on december 2009
> JAVA -Senior level position
  • What is the OOPS concepts? And list them
  • What is polymorphism
  • what is the functionalities added into java 1.5 (eg. generic e.t.c)
  • What are the collection interfaces you know? and list them
  • How generic applies to collection interfaces?
  • Design pattern in depth.
  • Garbage collection mechanism
  • Exception handling
> Struts 1.2
  • Process flow of struts
  • What are the files getting created in simple sign-in application in struts?
  • difference b/w struts 2.0
  • diff b/w inculde redirect and include directive
  • How can write method in JSP
  • what are the implicit objects
> Servlet
  • Servlet life cycle.
  • how can servlet communicate with the view layer
  • how may servlet instance will create for 10 requests.
> Hibernate
  • What is hibernate
  • How is the entire architecture for hibernate
  • What is the difference between head and trunc?

Share your thoughts

Monday, December 7, 2009

Here we start

  • This Blog says about different technological topics using Bullets and numbering only.
  • This bullet board brings the advantageous
  1. Get/Understand the contents easily
  2. Important things comes first; So it will be a perfect companion for your exam or interview
  3. Greatest technological topics brings to you
Share your thoughts

Thursday, September 10, 2009

Chennai Diary

I had a trip in the last weekend to Chennai (one of the hottest city I went in my life) .
I started Friday evening from Bangalore by bus, It costs around 450/- only, Be prepared otherwise you may end with giving more money to travel agents

Travel Cost
  • By travels bus 450 - 550 Rs
  • By KSRTC (karnataka)
  • Sheetal A/c 420/-
  • Volvo/Rajahamsa 800
  • By TN Bus 250 most reasonable
And it took around 6 hrs to reach koyambedu bus stand, This is the place where all the buses final destination. Be alert.. Don't go directly to auto rikshaw guys they will squeeze you in a good shape.. Call ur friend and get the guidence.. My friend came to koyambedu picked up me in to his place named ambal nagar.
Because this city one of the oldest city, the authorities planned excellently lead to widest roads and 4 lane roads which gives a nice ride even the city having a huge number of vehicles.
<<Mareena Beach
we planned to go lot of places in the very next day but the plans ended with the visit to mareena beach one of tsunami worst hit beaches in Asia. We reached, me with my friend suveen around 5:00PM. Because of Sunday there where huge crowd gathered there. The we can find a big number of pani-poori sellers, fruit vendors and seashells sellers e.t.c.. And we saw a huge number of people enjoying in the lap of sea. We took a lot of photos from there. Due to the fasting I were tired so much. And after the breaking of fasting and prayers we returned from mareena beach around 7:30 PM

Return journey was very good, It was in the a/c bus of karnataka. Which costs around 420 rs. I met one animator in the bus(name I forget) who working for Dream world which is a venture from Steven Spielberg.. As per his suggestion following thins will be interested for animation lovers
  • Great animation pictures
  1. Shrek 1to 3 (shrek-4 is in making)
  2. Wall-e
  3. Finding nemo
  • Largely using software for animation - Maya
  • Guidelines to freshers in Animation stream
Join in small companies who working in animation field as an animator or compositor. There you will get multiple roles other than your designation and ready to occupy yourself. Then decide your own area of specialization. Get into those area when chance arrives.

Share your thoughts

Thursday, July 30, 2009

How to find occurence of a string in a file

Single occurrence
This java program helps to find the occurrence of a string in a file. It will print the location of the string in the console as output. You can use this program as append with the web application you developing or as a separate stand alone program

Expected input : file name, Search String

Given the utility method only
public void searchString(String fileName, String searchText) {
StringBuilder sb = new StringBuilder();
String line=null;
try {
BufferedReader reader =new BufferedReader(new FileReader(fileName));

//Reads until the end-of-file met
while( null != ( line = reader.readLine() ) ){

//Read line-by-line directly
} catch (IOException ex) {
String fileText = sb.toString();
System.out.println("Position in file : " + fileText.indexOf(searchText));


multiple occurrence of the String in a file
By fine tuning the above program you can find the multiple occurrence of the String in a file by using the method given below. The input for the program is the individual lines getting from the file using the method readLine()
private Boolean ifWordsExists(String line, String searchText, SearchBean fo) throws IOException {
StringBuffer bf = null;
int index = 0;
Boolean flag = false;
if (line.indexOf(searchText) > -1) {
flag = true;

return flag;
Here it will returns the value true if the string find in the line supplied. And after setting the founded line in array list you can display it on the web application
Share your thoughts

Thursday, July 23, 2009

This HelloWorld program to java world

We can step into the world of java by this simple program
  1. class JavaDemo{
  2. public static void main(String Args[])
  3. {
  4. System.out.println("HelloWorld!");
  5. }
  6. }
  • Line1: Every java program starts with class keyword and followed by user defined class names
  • Line2:
    * public: The method can be accessed outside the class / package
    * static: You need not have an instance of the class to access the method
    * void: Your application need not return a value, as the JVM launcher would return the value when it exits
    * main(): This is the entry point for the application
  • Line 3: curly braces opens here or just immediately after method name
  • Line4 : Printing the String constant into the console
  • Line5 : close the bracket for method
  • Line 6 : close the bracket for class JavaDemo
In order to run this program you have to compile this program into bytecode by the command ->javac
And Run the program by typing the below command
-> java JavaDemo
You can see the following output

follow me on twitter::
Share your thoughts


J2EE Its really VAST but not WASTE :)
I cant say while updating this blog, how many new components being adding to the J2EE stuff or how many component's version number changing in upward or downward.. Really it is saying by the geeks that we are in the changing world. Really technology changing in fast pace. But if we simply say, this list for j2ee is huge still growing never shrinking.. You have to update yourself in the newest technologies to stay in this stardom. Naming few here in the following list. By clicking on the individual item you can get a birds-eye-view of the related technology.
  • JAVA
  • JSP
  • Servlet
  • JSF
  • Struts
  • Hibernate
  • EJB
  • JMS
  • JDBC
In addition to this a J2ee developer have to be well versed in the technologies related fundas design pattern, XML, Application/web servers and many many more. I think everybody scared of being in to the java technology by seeing this list. Instead of they being into .net or database and many more.

follow me on twitter::
Share your thoughts

Thursday, May 28, 2009

Wayanad the place where I lives

Wayanad My Place
The natural scenic beauty of Wayanad and its rich natural resources offer several opportunities for adventure tourism. The hills rocks and valley which make the very unique character of Wayanad provide a lot for catering to the ever increasing demand for adventure tourist.
There three big towns are there in wayanad. Named sulthan battery, Mananthvady and Kalpetta. Below listing the tourist centers nearest to these towns
Sulthan Battery
Edakkal Caves

The Edakkal Caves are at Ambukutty Mala. It is a pre-historic rock shelter formed naturally out of a strange disposition of three huge boulders making one to rest on the other two with its bottom jutting out in between and serving as the roof. ‘Edakkal’ in Malayalam literally means a stone in between.
The discovery of the cave and its identification as a prehistoric site were quite accidental by F. Fawcett, the then superintendent of police. An enthusiast in pre-history, Fawcett went around exploring the Wayanad high ranges which eventually led to the discovery of the Edakkal rock-shelter in 1894. He identified the site as a habitat of neolithic people on the basis of the nature of representations on the cave walls, which appeared to him as engravings made of neolithics celts.
Edakkal rock engravings stand out distinct among the magnitude of prehistoric visual archives of paintings and graphic signs all over the world. It is the world's richest pictographic gallery of its kind.

Kuruva Dweep

950 acres of evergreen forest surrounded by east flowing river, Kabani. Rare species of birds, orchids and herbs are sovereigns of this supernatural kingdom. It is 17kms. east of Mananthavady and 45 kms. north-west of Sulthan Bathery.
Sulthan Bathery Jain Temple

It is generally known as Tippu's Fort and situated at Sulthan Bathery town. Tippu used this temple as the Battery of his army.
Chembra peak

Trekking to the Chembra peak is one of the risky tourist endeavours. Chembra peak is the highest peak in Wayanad at 2100m. above mean sea level. It is14 kms. west of Kalpetta. Trekking to the top of this peak takes almost a day. Tourists can also stay one or two days at the top of the peak in temporary camps. District Tourism Promotion Council provides guides, sleeping bags, canvass huts trekking implements on hire charges to the tourists. The scenic beauty of Wayanad which is visible from the top of Chembra is very challenging and thrilling. The blue eyed water in the lake at the top of the hill never dries up even in the peak of summer. All along the steep and slippery way to the top of the hill, the whispering of the flowing spring which sprouts from the top of the hill accompanies the tourist. If he is fortunate enough, on his way he may come across a passing wild beast, may be a leopard who may instantly hide behind the bushes. Camping in the night with camp fire and sleeping bags at the top of the peak in shivering cold is everlasting experience. Trekking equipments are available at Tourist Information Centre, Kalpetta.

Banasura Dam

The largest earth dam in India, 15 kms north-west of Kalpetta. This large expanse of water bounded except on one side with magnificant hills has heavenly charm.
Puliyar Mala Jain Temple

It is 5 kms noth of Kalpetta. This temple is devoted for Anantha natha Swami, one of the saints of Jaina faith. Pallikunnu Church

It is 12 kms. north of Kalpetta. The famous festival is in the month of January. Varambetta Mosque

It is the oldest mosque in Wayanad (300 years old), situated 15 kms. south-east of Kalpetta, near Padinjarathara
Meenmutty Water Fall

12 kms. east of Meppadi. Water falls to a depth of more than 500m. in 3 steps.

Sentinal Rock(Soochipara) Water Fall

at Soochipara near Meppadi 22 kms. south of Kalpetta. A three step water fall of more than 200m inheight with a fantastic scenary provides for white water rafting, swimming, bathing, etc., The tree top huts at Soochipara will give unique view of the valleys of Western Ghats. It is also an ideal place for rock climbing

Kanthan Para Water Fall

a beautiful water fall of about 30m. in height, 8 km east of Meppadi and 12 kms. south-east of Kalpetta

Pakshipathalam in Bramha Giri hills at Thirunelly is a challenging tourist spot. It is 7 kms. north-east of Thirunelly temple and is situated 1740m. above mean sea level. To reach 'Pakshipathalam', 17 kms. have to be covered through wild forest. The deep rock caves formed among the thick blocks of rocks at the northern top end of the Brahmagiri is the abode of various birds and wild beasts. To go to 'Pakshipathalam' special permission has to be obtained from forest department. DTPC (District Tourism Promotion Council) arranges vehicle, guides, camping apparatus etc. to the tourists on hire charges.

Thirunelly Temple

It is known as 'Thekkan Kasi', of Kerala. It is believed, that a dip in the river Papanasini, running crystal clear down hill, wipes one off all sins. Thirunelly is 30 kms. north-east of Manathavady.
Valliyoorkav Temple

is 3 kms. east of Mananthavady. The 10 day festival during the month of March-April is very famous
Pazhassi Tourist Resort

The DTPC has organised a park at Kabani river side, 1 km. south of Mananthavady. Boating in Kabani River Children's park, children's traffic park and sales counter for handicrafts and spices are arranged here.
Pazhassi Memorial

The body of Veera Pazhassi, the Lion of Kerala who organised a guerilla war against the British East Indian Company is buried at Mananthavady, which is 32 km north east of Kalpetta.
Jain Temples at Panamaram

These ruined Jain Temples are situated within 5 kms. North-east of Panamaram.
Pookot Lake Tourist Resort

This resort in Vythiri is the most sought - after tourist spot of Wayanad. Boating facilities are arranged to the very vast natural lake which lies in the lap of surrounding mountains. Thicks bushes and tall trees along the path round the lake gives a calm spiritual atmosphere. A fresh-water aquarium with wide varieties of fishes is managed by Fisheries Department. Children's park and shopping centre for handicrafts and spices of Wayanad are arranged by DTPC .
Lakkidi Ghat Pass

It is the Gate Way of Wayanad above the Thamarassery Ghat Pass of western ghat, at an elevation of 700m above mean sea level. Deep valley to the south with winding roads through thick forest attract many. It is 55 kms. east of Kozhikode and 5 kms. south of Vythiri
Rivers: Kabani river, one of the three east flowing rivers of Kerala, is an important tributary of the river Cauvery. Kabani and its tributaries constitute a powerful river system in the land scape of Wayanad. Panamaram rivulet takes its origin from the perennial lake called, 'Pookode lake'. It flows swiftly through mountain gorges and joined by other streams, tumbles down into Panamaram valley. Six kilometres further from Panamaram, this river joins with the Mananthavady rivulet, originating from the lower regions of the peak 'Thondarmudi'. From this confluence onwards, the river is known as Kabani, a mighty, perennial river which after entering Karnadaka State, joins with the river Cauvery. Almost entire Wayanad is drained by the Kabani river and its tributaries, namely, Panamaram river, Mananthavady river and Thirunelli river.

Tourist Information Office Place Phone
District Tourism Promotion Council, Kalpetta
Tourist Information Center, Kalpetta
Bus stations Bus Stations Phone

Sulthan Bathery
240640, 240240
Tourist Information Offices

DTPC, Kalpetta
DTPC, Pookot
Tourist Information centre, Kalpetta
From Sulthan Battery to

Share your thoughts

Wednesday, May 6, 2009

life is a game impossible is nothing

Following is the one of good forward mail I got ever...

This is a case of photographer photographs photographer. The following photographs were taken by photographer Hans van de Vorst at the Grand Canyon, Arizona. The descriptions are his own. The identity of the photographer IN the photos is unknown.

I was simply stunned seeing this guy standing on this solitary rock IN the Grand Canyon.
The canyon's depth is 900 meters here. The rock on the right is next to the canyon and safe.
Watching this guy on his thong sandals, with a camera and a tripod I asked myself 3 questions:

1. How did he climb that rock?
2. Why not taking that sunset picture on that rock to the right, which is perfectly safe?
3. How will he get back?

After the sun set behind the canyon's horizon he packed his things (having only one hand available)
and prepared himself for the jump. This took about 2 minutes.
At that point he had the full attention of the crowd.

After that, he jumped on his thong sandals...
The canyon's depth is 900 meters here.

Now you can see that the adjacent rock is higher so he tried to land lower, which is quite steep
and tried to use his one hand to grab the rock

We've come to the end of this little story. Look carefully at the photographer.
He has a camera, a tripod and also a plastic bag, all on his shoulder or in his left hand.
Only his right hand is available to grab the rock and the weight of his stuff is a problem.

He lands low on this flip flops both his right hand and right foot slips away...
At that moment I take this shot.

He pushes his body against the rock.
He waits for a few seconds, throws his stuff on the rock, climbs and walks away.

Impossible is Nothing

Life is a game.
Share your thoughts