Skip to content
Techy PiD
  • Pro Scripts & Code
  • Android Quiz
  • Android Tutorials
    • Create UI in android studio
    • Android SQLite database
    • PHP API and JSON parsing
  • Toggle website search
Search this website
Search this website
  • Pro Scripts & Code
  • Android Quiz
  • Android Tutorials
    • Create UI in android studio
    • Android SQLite database
    • PHP API and JSON parsing
  • Toggle website search

Count vowels and consonants in a given string

Write a Java program to count the number of vowels and consonants in a given string. The provided Java program counts the number of vowels and consonants in a given string. class Main { public static void main(String[] args) { String str = "Hello"; countVowelAndConsonant(str);…

Continue ReadingCount vowels and consonants in a given string

Checks whether a string is a palindrome or not

Write a Java program that checks whether a string is a palindrome or not. The provided Java program checks whether a string is a palindrome or not. A palindrome is a word or phrase that reads the same forward and backward (ignoring spaces, punctuation, and…

Continue ReadingChecks whether a string is a palindrome or not

Find the sum of elements in an array

Write a Java program to find the sum of elements in an array. The provided Java program calculates the sum of the elements in an array. class Main { public static void main(String[] args) { int[] arr = {6, 6, 7, 8, 8, 9}; int…

Continue ReadingFind the sum of elements in an array

Practice Program: remove duplicates from an array

Write a Java program to remove duplicates from an array. This Java program efficiently removes duplicate elements from an array using the Arrays.stream() and distinct() methods, which are part of the Java Streams API introduced in Java 8. Here’s an explanation of how it works:…

Continue ReadingPractice Program: remove duplicates from an array

Find the second largest element in an array

Write a Java program to find the second largest element in an array. This program finds the second largest element in an array. class Main { public static void main(String[] args) { int[] arr = {3, 56, 8, 43, 44}; // Example array // Call…

Continue ReadingFind the second largest element in an array

find the maximum and minimum values in an array

Write a Java program to find the maximum and minimum values in an array. This program efficiently finds the maximum and minimum values in an array. class Main { public static void main(String[] args) { int[] arr = {2, 6, 8, 5, 6}; // Sample…

Continue Readingfind the maximum and minimum values in an array

Java Practice Program: reverse an array

Write a Java program to reverse an array. This program reverses an array in-place and prints both the original and the reversed arrays. Here's how it works: class Main { public static void main(String[] args) { int[] arr = {1, 5, 2, 5, 7}; //…

Continue ReadingJava Practice Program: reverse an array
  • 1
  • 2
  • 3
  • 4
  • Go to the next page

Similar articles

  • Java Practice Program: given number is a palindrome
  • Java Practice Program: diamond-shaped pattern
  • Practice Program: remove duplicates from an array
  • Java Practice Program: reverses given number
  • Java Practice Program: prime number
  • Find the second largest element in an array
  • RadioButtons value in the SQLite, display ListVie…
  • SQLite CRUD operation with example in android
  • RecyclerView CRUD operation with image
  • working with SQLite database in android
  • SQLite database CRUD operation with image
  • Bottom Navigation menu with Centered Floating Bar
  • Cardview inside GridLayout in Android Studio
  • beautiful Gridview in android with example
  • Send data from one activity to another activity in…
  • Adding a menu to the toolbar in android
  • How to convert android LinearLayout to PDF in andr…
  • Easy Guide to Add Bottom Navigation in Android Stu…
  • Send data and generate downloadable PDF file
  • How to change default launcher icon in app?
  • Add Dark and Light Mode In android App
  • Privacy Policy
  • Contact
  • About Us
Copyright © 2021-25 | Techy PiD - All Rights Reserved