Showing posts with label Java Programming. Show all posts
Showing posts with label Java Programming. Show all posts

Thursday, September 12, 2019

Calculate factorial of a number using Recursion


Calculate factorial of a number using Recursion




import java.util.Scanner;

public class FactorialOfNumber {

      static int factorial(int n) {
            if (n == 0)
                  return 1;
            else
                  return (n * factorial(n - 1));
      }

      public static void main(String args[]) {
            int i, fact = 1;
            //Input the number
            System.out.println("Enter a Number");
            Scanner sc= new Scanner(System.in);
            int number = sc.nextInt();
           
            fact = factorial(number);
            System.out.println("Factorial of " + number + " is: " + fact);
      }
}



Output:

Enter a Number

5
Factorial of 5 is: 120

Wednesday, September 11, 2019

Print * Patterns in Java

Print * Patterns in Java


* * * * *
 * * * *
  * * *
   * *
    * 

   


Java Code:


public class PatternEx3 {

      public static void main(String[] args) {
            int row = 5;
            for (int i = 0; i <= 5; i++) {
                  // Printing i spaces at the beginning of each row

                  for (int j = 1; j <= i; j++) {
                        System.out.print(" ");
                  }

                  // Printing j *'s at the end of each row

                  for (int j = row; j > 0; j--) {
                        System.out.print("* ");
                  }

                  System.out.println();

                  // Decrementing the row

                  row--;
            }

      }

}

Tuesday, June 25, 2019

JSP Introduction presentation

JSP Introduction presentation


JSP Introduction


A JSP page is a text document that contains two types of text: static data, which can be expressed in any text-based format (such as HTMLSVGWML, and XML), and JSP elements, which construct dynamic content.

The recommended file extension for the source file of a JSP page is .jsp. The page can be composed of a top file that includes other files that contain either a complete JSP page or a fragment of a JSP page. The recommended extension for the source file of a fragment of a JSP page is . jspf.


A JavaServer Pages component is a type of Java servlet that is designed to fulfill the role of a user interface for a Java web application. Web developers write JSPs as text files that combine HTML or XHTML code, XML elements, and embedded JSP actions and commands.

JSP Introduction presentation





Saturday, June 15, 2019

What is Java

Welcome to the world of Java Programming

What is Java?

Java is programming language and platform first released in 1995.


Java is one of the most widely used and robust programmings language. You can find it everywhere. Let us start our journey with JAVA.


This section describes Java. There is an interesting History behind the evolution of Java language. Be with us. You are entering in a beautiful world of programming.




   This is the First Example of Java. Just to show you the Simple class structure of Java.
    This class is just printing Hello World.


 These are the different application of Java.
 You can see here that Java is in every area. 
 So You can understand its importance better.



    Below are different applications of java. Java is used to build different kinds of applications.
    Each of the below applications described in the subsequent sections.


     Have you seen some Java Desktop Applications?.
     For Example, you make some simple calculator in java and run in your desktop.
     Desktop applications do not require browser help.


  Web Applications running on the server. For Example the HSBC, HDFC bank site.
 


 



  These are different Java platforms according to the users need.
For Example below link will take you to download the Java Standard Edition JDK 8.
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html



   Now Each one of the editions Described with the help of examples.

Here Java SE contains the core java libraries.You can say these are the core Java libraries.



    After the core Java, you need to build Web Applications. For this you need Java EE which includes JSP,Servlet etc. By using these you can create best applications.



   Thank you for being with us. Visit for other sections of Java also.





Saturday, May 25, 2019

Agile Methodology and Software Testing Techniques

Software Development Life Cycle

SDLC by Dinesh Kumar

Agile Methodology and Software Testing Techniques in One page

Create a Digital Clock using HTML and JavaScript

Create a Digital Clock using HTML and JavaScript  <! DOCTYPE html> < html > < head > ...

Followers

Search This Blog

Popular Posts