Category: Java Simple Programs

JAVA Program to Accept Value from Command Line 0

JAVA Program to Accept Value from Command Line

Follow me 88 Barontuts   JAVA Program to Accept Value from Command Line: import java.io.*; class cmd { public static void main(String args[]) { String a=args[0]; int b=Integer.parseInt(args[1]); System.out.println(b); System.out.println(a); } } OUTPUT: 88...

JAVA Program to Accept Value using Buffered Reader 0

JAVA Program to Accept Value using Buffered Reader

Follow me JAVA Program to Accept Value using Buffered Reader: import java.io.*; class buffrdredr { public static void main(String args[]) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); System.out.println(“Enter any String “); String a=br.readLine(); System.out.println(“Enter...

JAVA Program to Find Sum of Digit of Number 0

JAVA Program to Find Sum of Digit of Number

Follow me JAVA Program to Find Sum of Digit of Number: import java.io.*; class sod { public static void main(String args[]) { String a=”1234″; int sum=0,rem=0,len; len=a.length(); int no=Integer.parseInt(a); for(int i=1;i<=len;i++) { rem=no%10; sum=sum+rem;...