Sunday, 27 April 2014

The Five Evils Of Human.


These are the five things that must leave  human from life.
Five enemy of a man:
The Five Evils Of Human.

1. Kaam(lust):
 
2. Krodh (rage):
Anger is worst enemy of human.

3. Lobh (greed):
One must control ones greedy nature. 



4: Moh (attachment):

5: Ahankāra  (ego):


Friday, 25 April 2014

Five Things That Make A Man Happy

Five Things That Make A Man Happy

Five Things That Make A Man Happy:

1. Honesty & trust:

Everyone knows "Honesty is the best policy" but forget to apply it in life. By honesty we can get the faith of others and results true happiness. 

2. Respect:

Man is always hungry to respect. If you want to be happy give respect to others it keeps you high in eye of others. You get good feeling and high satisfaction from inside by doing this.

3. Sense of humour:

It makes human being different from others each have different sense of humour. No you ask how it help to be happy. If you have good sense of humour your perception increases and more ways opened to you.

4. Intelligence & confidence:

Always be confident because it keeps you ready all the time to capture happiness from small small things. 

5. Art of scarifies:

Everyone know Man feel better to help others Art of scarifies gives true happiness.
Every man have some ambitions but all are not completed. So man must have giving nature to be happy in life.

Posted By:Tanuj Kumar 
On:Shareyourconscience

Sunday, 6 April 2014

Five Things To Increase Wealth And Prosperity

Keep these five thing to increase income and money. 

1.Flute

Put any kind of flute at home to increase income.


2.Dancing Image Of Sri Ganesh: 

Put dancing image of Ganesh ji which is watching the main door .
Dancing Ganesha

3.Kuber Statue In North Side Of Home:

To increase income put it.

4. Southward Shankha:

Put shankha in red cloth in place of worship.




5:Coconut:

Saturday, 1 February 2014

Interview question code


Interview question code

Question :- wap to print the numbers from 1 to 50. But in multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"



solution:-

         public class FizzBTest
{
 //Create main function
    public static void main(String args[])
  {
           for(int i = 1; i <= 50; i++) 
          {
            if(i % (3*5) == 0) System.out.println("FizzBuzz");
            else if(i % 5 == 0) System.out.println("Buzz");
            else if(i % 3 == 0) System.out.println("Fizz");
            else System.out.println(i);
         } 
   } 

}


Posted By:M@ddy Th@kur 
On:Shareyourconscience

Saturday, 18 January 2014

Sunday, 12 January 2014

Java problem to delete all duplicate digits from an input number?

Java problem to delete all duplicate digits from an input number?

Question:Write a program in java to delete all duplicate digits from an input number?

 Eg: if input is 112354 then output will be 12354 

Answer

import java.util.*;
public class duplicate {

public static void main(String args[]) 
{ long n;
int i=0,l=0,k=0;

Scanner sc=new Scanner(System.in);
System.out.println("Enter the number:");
n=sc.nextLong();
String s=Long.toString(n);
char c[]=new char[s.length()];
ArrayList cc=new ArrayList();
String temp = Long.toString(n);
int[] arr = new int[temp.length()];
for (int m = 0; m< temp.length(); m++)
{
arr[m] = temp.charAt(m) - '0';
}
for(i=0;i<s.length();i++)
{
for(int j=0;j<s.length();j++)
{

if(arr[i]==arr[j]&&i!=j)
{
l=1;
}

}
if(l==0)
{
cc.add(arr[i]);
k++;
}
l=0;
}
Iterator itr=cc.iterator();
while(itr.hasNext())
{
Object ans=itr.next();
System.out.print(ans);

}
}
}


Posted By:Tanuj Kumar 
On:Shareyourconscience

Monday, 30 December 2013

Most frequently asked interview question on String in java

Most frequently asked interview question on String in java

 Here we describe difference between (==) and .equals() :-

Both of them very much differ in their significance and working as equals() method is present in the java.lang.Object class and it is expected to check for the equivalence of the state of objects! That means, the contents of the objects. Whereas the '==' operator is expected to check the actual object instances are same or not.
Let us see an example we have two String objects and they are being pointed by two different reference variables as a1 and a2.

 a1 = new String("xyz");
 a2 = new String("xyz");
Now, if you use the "equals()" method to check for their equivalence as

 if(a1.equals(a2))
      System.out.println("a1.equals(a2) is TRUE");
 else
      System.out.println("a1.equals(a2) is FALSE");
You will get the output as TRUE as the 'equals()' method check for the content equivality.
Lets check the '==' operator..

if(s1==s2)
     System.out.printlln("a1==a2 is TRUE");
   else
     System.out.println("a1==a2 is FALSE");
Now you will get the FALSE as output because both a1 and a2 are pointing to two different objects even though both of them share the same string content. It is because of 'new String()' everytime a new object is created.
Try running the program without 'new String' and You will get TRUE for both the tests. 

   String a1 = "xyz";
   String s2 = "xyz";

                                                         

Posted By:M@ndeep R@w@t
On:Shareyourconscience