0% found this document useful (0 votes)
25 views2 pages

Department of Information Technology

The document is an experiment report submitted by a student for their Java programming class. It details two Java programs, one that takes command line arguments and calculates the sum of two integers, and another that takes a string as a command line argument and checks if it is a palindrome. The student's aim was to demonstrate the use of command line arguments in Java programs.

Uploaded by

Parvi Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Department of Information Technology

The document is an experiment report submitted by a student for their Java programming class. It details two Java programs, one that takes command line arguments and calculates the sum of two integers, and another that takes a string as a command line argument and checks if it is a palindrome. The student's aim was to demonstrate the use of command line arguments in Java programs.

Uploaded by

Parvi Agrawal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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