Write a java program to obtain constructors of a class?
class ConsInfo { public static void main(String[] args) { if (args.length == 0) { System.out.println("PLEASE PASS THE CLASS NAME..!"); } else { try...
Identifiers in Java
A name in the program is an identifier it may be class name or method name, variable name or label name.Rules for defining...
Print Sum of Series 1/1^2 + 1/2^2 + 1/3^2 …………1/n^2 in Java.
import java.util.Scanner; public class Series { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the no of terms...
Print Sum of series 1+ (1+2) + (1+2+3)……. (1+2+3+…….n) in Java
import java.util.Scanner; public class Series { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Enter the no of...
Print sum of series 1/1^3 – 1/2^3 + 1/3^3…….1/n^3 in Java.
import java.util.Scanner; public class Series { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double sum = 0;...
Print Series 1, 11, 111, 1111……..n terms in Java.
import java.util.Scanner; public class Series { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.print("Enter the number of terms:...
Print Series 1, 12, 123, 1234, …………n in Java.
import java.util.Scanner; public class Series { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.print("Enter the number of terms:...
Print Series 1, -3, 5, -7, …………n terms in Java.
import java.util.Scanner;public class OddSeries { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.print("Enter the number of terms: "); int n...
Print Series 2, -4, 6, -8,………n terms in Java
import java.util.Scanner;public class Series { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int c, i = 2, n; ...