You are on page 1of 2

Department of Information Technology

Academic Year: 2019-2020 Name of Student:Piyush Kurkure


Semester: III Student ID:189104031
Class / Branch: SE/IT Date of Performance:14/10/2019
Subject: JAVA Date of Submission:14/10/2019
Name of Instructor:RUJATA CHAUDARI

Experiment No. 7

AIM : Write a Java program to demonstrate command line arguments

Program1:
import java.util.*;
class sum
{
public static void main(String arg[])
{
int x,y,z;
x=Integer.parseInt(arg[0]);
y=Integer.parseInt(arg[1]);
z=x+y;
System.out.println("sum="+z);
}
}

OUTPUT:
Program2:

import java.util.*;
class rev
{
public static void main(String A[])
{
String o, r= "";
o=A[0];
int i,l;
l=o.length();
for(i=l-1;i>=0;i--)
{
r=r+o.charAt(i);
}
if(o.equals(r))
System.out.println("String is Pallindrome");
else
System.out.println("String is not Pallindrome");
}
}
Output:

You might also like