The Java language provides special support for the string concatenation operator ( + ), and for conversion of other objects to strings. String concatenation is...
Author - Mathan Lal
Code package com.candidjava.code; class SumOfNum { public static void main(String args[]) { int sum = 0; int n=10; for(int i = 1;i <= n;i++) { sum = sum +...
The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications Candidjava example gives a simple...
Code package com.candidjava.code; class SumOfNum { public static void main(String args[]) { int sum = 0; for (int i = 1; i <= 100; i++) { if (i % 2 != 0) {...
Program package com.candidjava; public class PatternNumberSequence { public static void main(String[] args) { int a = 3; int b = 4; int n = 8; for (int i = 1;...
Program package com.candidjava; public class RemoveAllVovels { public static void main(String[] args) { String string = "Welcome to Candid Java Programming";...
Program package com.candidjava; public class RemoveDuplicatesWords { public static void main(String args[]) { System.out.println("Input String"); String...
Program public class SmallestNumberIndex { public static void main(String[] args) { int a[] = new int[]{12,44,23,56,9,23,78,13}; int min = a[0]; int index=0;...
1.What is polymorphism and what are the types of it?Single task can be done in different way.Method overloading(compile time polymorphism),method...
Program package com.candidjava; import java.util.Scanner; public class PalindromeUptoN { public static void main(String[] args) { int n, b, rev = 0; Scanner sc...
program package com.candidjava; import java.util.*; public class StringVovelReplaceStar { static Scanner sc = new Scanner(System.in); public static void...
package com.candidjava.code; class OddNumber { public static void main(String args[]) { System.out.println("The Odd Numbers are:"); for (int i = 1; i <=...
FileReader and FileWriter can be combined together to copy a content from one file examble import java.io.BufferedReader; import java.io.FileReader; import...
This example shows you how to find largest or maximum number in an array Step 1:Initialize array valueStep 2: (int max = a[0];)Initialize max value as...
programing package com.candidjava; import java.util.Scanner; public class NumberToWords { public void pw(int n, String ch) { String one[] = { " ", " One", "...
This example shows you how to find the second largest number in an array of java Step 1: Iterate the given array Step 2 (first if...
This simple example shows you how to find the index of largest number in an array using simple for loop Step 1: Assign array value...
Program import java.util.Calendar; import java.util.TimeZone; public class TimeZone { public static void main(String[] args) { // TODO Auto-generated method...
Program import java.sql.Timestamp; import java.time.Instant; public class TimeStamp { public static void main(String[] args) { // TODO Auto-generated method...
Program import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import com.sun.org.apache.xerces...