How to solve Could not find or load main class
$ java helloworldError: Could not find or load main class helloworld Reason 1 – Made a mistake with the classname argument a simple class name: java ListUser
$ java helloworldError: Could not find or load main class helloworld Reason 1 – Made a mistake with the classname argument a simple class name: java ListUser
Java program for Linux server to EC2 instance with ppk file,
import java.util.*; class ArmstrongNumber { public static void main(String args[]) { int n, sum = 0, temp, r; Scanner in = new Scanner(System.in); System.out.println(“Enter a number to check if it … Read More
import java.util.Scanner; class FloydTriangle { public static void main(String args[]) { int n, num = 1, c, d; Scanner in = new Scanner(System.in); System.out.println(“Enter the number of rows of floyd’s … Read More
import java.util.*; class ReverseString { public static void main(String args[]) { String original, reverse = “”; Scanner in = new Scanner(System.in); System.out.println(“Enter a string to reverse”); original = in.nextLine(); int … Read More
import java.util.Scanner; class CompareStrings { public static void main(String args[]) { String s1, s2; Scanner in = new Scanner(System.in); System.out.println(“Enter the first string”); s1 = in.nextLine(); System.out.println(“Enter the second string”); … Read More
import java.util.Scanner; class LinearSearch { public static void main(String args[]) { int c, n, search, array[]; Scanner in = new Scanner(System.in); System.out.println(“Enter number of elements”); n = in.nextInt(); array = … Read More
import java.util.Scanner; class BinarySearch { public static void main(String args[]) { int c, first, last, middle, n, search, array[]; Scanner in = new Scanner(System.in); System.out.println(“Enter number of elements”); n = … Read More
import java.util.Scanner; class SubstringsOfAString { public static void main(String args[]) { String string, sub; int i, c, length; Scanner in = new Scanner(System.in); System.out.println(“Enter a string to print it’s all … Read More
import java.util.*; class GetCurrentDateAndTime { public static void main(String args[]) { int day, month, year; int second, minute, hour; GregorianCalendar date = new GregorianCalendar(); day = date.get(Calendar.DAY_OF_MONTH); month = date.get(Calendar.MONTH); … Read More