Count All Vowels In A String Java With Source Code

The Count All Vowels In A String Java is a fully functional console based project written in the Java programming language that works perfectly. This Java Method To Count All Vowels In A String is a fundamental project for IT students and other computer-related students. It will assist students in completing college projects and requirements. This program can be helpful in counting the number of vowels.

This Count Number Of Vowels In A String is beneficial for practicing Java development and gaining new skills. This project is quite useful, and the concept and logic are simple to grasp. The source code is open source and is free to use. Simply scroll down and click the download button.

How To Count Vowels In A String In Java

To determine how many vowels are present in a sentence, use the following method :

  • Read one of the user’s sentences.
  • Create a variable (count) and set its value to 0;
  • Compare each word in the sentence to the letters “a,” “e,” I “o,” and “u.”
  • If a match happens, the count goes up by one.
  • Last, make a count.
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
package count_all_vowels_in_string;

import java.util.Scanner;

public class Count_all_Vowels_in_String {

     * @param args the command line arguments
    public static void main(String[] args) {
        int count = 0;
        System.out.println("Enter a sentence :");
        Scanner sc = new Scanner(;
        String sentence = sc.nextLine();

        for (int i = 0; i < sentence.length(); i++) {
            char ch = sentence.charAt(i);
            if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == ' ') {
        System.out.println("Number of vowels in the given sentence is " + count);


Example Output

Example Output
Example Output

Anyway, if you want to level up your programming knowledge, especially Java, try this new article I’ve made for you Best Java Projects With Source Code For Beginners Free Download 2021.

To start executing a , makes sure that you have NetBeans IDE or any platform of Java installed in your computer.

About the Project : Count All Vowels In A String Java With Source Code

The Count All Vowels In A String Java was made using Java programming and the NetBeans IDE (Integrated Development Environment), but you can use any code editor as long as the project can run. This Count Number Of Vowels In A String In Java will teach you how to use Java to count the number of vowels, numbers, and spaces in a sentence. The main goal of this project is to make it easy to keep track of how many vowels are in each sentence. The project is easy to figure out. You only need to look around and learn each code to understand and build your unique project. I hope that this article will help you a lot on your way to becoming a good Java developer.

Count All Vowels In A String Java : Project Details And Technology

Project NameCount All Vowels In A String Java
AbstractThis Count All Vowels In A String Java Is a useful system if you want to learn Java or use it to make your own project. This is one of the most important things you’ll do on your way to becoming a Java developer.
Language UsedJava
IDE UsedNetBeans 11.2
TypeConsole Based Application
DeveloperGlenn Magada Azuelo
Count All Vowels In A String Java With Source Code – Project Information

Count All Vowels In A String Java : Steps On How To Run The Project

Time needed: 5 minutes

These are the steps on how to run Count All Vowels In A String Java

  • Step 1: Download source code.

    First, download the source code given below.
    Quicksort In Java Download Button

  • Step 2: Extract file.

    Second, after you finished download the source code, extract the zip file.
    Bubble Sort In Java Extract File

  • Step 3: Click open project.

    Third, open NetBeans IDE and click open project and choose your download source code.
    Bubble Sort In Java Open Project

  • Step 4: Run the project.

    Last, right click the project folder and click run.
    Bubble Sort In Java Execute Project

Download Source Code below!


The project, is made entirely out of Java and the MySQL Database. It has a Graphical User Interface (GUI) with all of the functions that stores need to improve customer satisfaction.

This article shows us how to improve our skills and logic, which is important for using the Java programming language, which is the most popular and widely used programming language in many businesses.

You can also get the source code for this simple project for free.


If you have any questions or suggestions about the project, please feel free to leave a comment below.

Leave a Comment