Posts

Featured Post

find the Second Highest Salary of Employee in SQL

  SELECT MAX(salary) FROM employee WHERE salary NOT IN (SELECT MAX(salary) FROM employee); =======================================================================                                                                      OR ======================================================================= select salary from employee order by salary desc limit 1 offset 1  ===============================================================

Remove Duplicate from a List in Java

public class Main {   public static void main(String[] args) {     // remove duplicates from a list     List < Integer > list = Arrays.asList(1, 2, 3, 2, 3, 1, 4, 1);     /*System.out.println("------ With Java 8 -------");          System.out.println(list.stream().distinct().collect(Collectors.toList()));*/          System.out.println("------ Without Java 8 -------");     List < Integer > l = new ArrayList < > ();     for (int i = 0; i < list.size(); i++) {       if (l.contains(list.get(i)) != true) {         l.add(list.get(i));       }     }     System.out.println(l);   } } ========================================================== Output [1,2,3,4]

Reverse a word from the given string in Java

public class Test {     public static void main(String[] args)     {         String str = "welcome to the java world";         String split[] = str.split(" ");         // I want to reverse java from the given String         String s= split[3];         String rev="";         for(int i=s.length()-1; i>=0; i--)         {             rev = rev+s.charAt(i);         }         System.out.println(rev);     } } --------------------------------------------------------------------------------------------------------------------------------- avaj

Prime No program in java

Prime no program in java Prime no program public class Test { public static void main(String[] args)   {    int primeno = 5;    int temp = 0;     for(int i = 1; i<=primeno; i++)      {       if(primeno%i==0)        {         temp++;        }      }     if(temp==2)      {       System.out.println("Given no is prime no.");      }     else      {       System.out.println("Given no is not prime no.");      }   } } Output is Given no is prime no.

Basic Java Program

Top 10 Java Basic Progragram 1.) Write a program for a palindrome no. and string ? 3.)  Write a program for a prime no. ? 4.)  Write a program for a reverse no. ? 5.)  Write a program for a reverse string  ? 6.)  Write a program for a Armstrong no. ? 7.)  Write a program for a Fibonacci series ? 8.)  Write a program for a sum of digit ? 9.)  Write a program for a swapping two no with third variable and without third variable. ? 10.)  Write a program for lowercase to uppercase and uppercase to lowercase ? 

HTML Interview Questions

  Q.1 What is HTML ? Ans.  HTML is a hyper-text-markup language. Which is used developed web pages and web based application.   Q.2 What is meant by hyper-text and markup language?   Ans. Hyper-text means, A text with in link and Markup-language means defines the tags used in the document. Q.3 Differences between tag and elements ?   Ans. HTML tag is like a opening and closing entity ex. <p> and </p>, where elements have opening, closing and content ex.<p>some content goes here</p>. Q.4 What is hyperlink  and how to create?   Ans. Hyperlink means, we can jump, one webpage to another webpage. We can create hyperlink by using anchor tag.   Q.5 How many types of heading in html ?   Ans. there are the six heading in html, h1 to h6. Q.6 Types Of List ? Ans. There are the three type of lists. i) Ordered List ii) Unordered List iii) Definition List Q.7 What is Block line and Inline elements ? Ans. Which elements always start with new line known as block line elem