Skip to content

eldhoseak/JavaBasicExamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JavaBasicExamples GitHub Actions status

This repository contains basic Java programs. Mainly used for training purpose.

ASSIGNMENTS ON STRING AND ARRAYS.

======================== STRING ASSIGNMENT

A. The string has a s.toCharArray() method that can be used for converting string to a character array. Example snippet below.

String s = "GeeksforGeeks"; char[] gfg = s.toCharArray(); for (int i = 0; i < gfg.length; i++) { System.out.println(gfg[i]); }

B. String has a split() method that allows you to split a string in to an array of strings. https://www.geeksforgeeks.org/split-string-java-examples/

  1. Reverse the String.
  2. Check if a string is palindrome?
  3. Count the number of words in a sentence?
  4. Remove extra white spaces in a sentence.

=============================== ARRAY ASSIGNMENT

  1. Remove duplicate elements in an integer array
  2. Find largest and second largest number in an integer array
  3. Sort the elements in an array in ascending order.
  4. Find the missing number in an Array between 1 to 100. Given only one number is missing.

About

Basic Java programs for training purpose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages