Author name: Neeraj Mishra

2 Ways to Convert String to Character Array in Java

Here you will learn about different ways to convert string to character array in java. 1. Using String.toCharArray() Method We can easily convert string to character array using String.toCharArray() method. It can be done in following way. package com; public class StringToArray { public static void main(String…s){ String str = “I Love Java”; char charArray[]; //converting …

2 Ways to Convert String to Character Array in Java Read More »

Java Program to Find Largest of Three Numbers

Here you will get java program to find largest of three numbers using if else statements. import java.util.Scanner; public class LargestNumber { public static void main(String…s){ int x, y, z, largest; Scanner sc = new Scanner(System.in); System.out.println(“Enter three numbers:”); x = sc.nextInt(); y = sc.nextInt(); z = sc.nextInt(); largest = x; if(y > x && …

Java Program to Find Largest of Three Numbers Read More »

Java Program to Calculate Area and Circumference of Circle

Here you will get java program to calculate area and circumference of circle. Formula used: Area of Circle = 3.14 * radius2 Circumference of Circle = 2 * 3.14 * radius import java.util.Scanner; public class Circle { public static void main(String args[]){ double radius, area, circumference; Scanner sc = new Scanner(System.in); System.out.println(“Enter radius:”); radius = …

Java Program to Calculate Area and Circumference of Circle Read More »