compile this program and let me know the resolution
class Maxof2{
public static void main(String args[]){
//taking value as command line argument.
//Converting String format to Integer value
int i = Integer.parseInt(args[0]);
int j = Integer.parseInt(args[1]);
if(i > j)
System.out.println(i+" is greater than "+j);
else
System.out.println(j+" is greater than "+i);
}
}
please compile and let me know the resolution
View Answers
January 6, 2011 at 2:04 PM
Hello Friend,
After compiling the code, while running the code, specify two arguments like this:
java Maxof2 4 5
The code take these values and check which is greater and display the output:
5 is greater than 4.
You can given any number as an argument.
Thanks
Ads
Related Tutorials/Questions & Answers:
compile this program and let me know the resolution
compile this
program and
let me know the resolution class Maxof2{
public static void main(String args[]){
//taking value as command line...+" is greater than "+i);
}
}
please
compile and
let me know the
resolution
 
Advertisements
how to compile and run servlet program
how to
compile and run servlet
program hello sir/mam i hve... it or
compile i m doing it first tyme pls help
me in sorting out this problem.
i hve seen rose india tips but not getting it pls help
me
How to compile and run Java program
How to
compile and run Java program How to
compile and Java
program...,
For compiling and running the Java
program from command prompt you should must have JDK... tutorial
Compiling and Running Java
program from command line.
If Java
answer me this program
answer
me this program Java Code to Maintain student record,Name, Age, Marks of 5 subjects for a Student,Display Student age and name,Calculate Average of all marks and display it
Java student record
import
answer me this program
answer
me this program Java Code to Maintain student record,Name, Age, Marks of 5 subjects for a Student,Display Student age and name,Calculate Average of all marks and display it
Java student record
import
compile
compile how to
compile a java
program using jre7
plaz help me i try to compile from last 2 day .
plaz help
me i try to
compile from last 2 day . org.apache.jasper.JasperException: Unable to
compile class for JSP:
An error occurred at line: 34 in the jsp file: /saveUpdate.jsp
name cannot be resolved to a variable
31
plaz help me i try to compile from last 2 day .
plaz help
me i try to
compile from last 2 day . org.apache.jasper.JasperException: Unable to
compile class for JSP:
An error occurred at line: 34 in the jsp file: /saveUpdate.jsp
name cannot be resolved to a variable
31
Please explain me the flow of this program..
Please explain
me the flow of this
program.. // Substring replacement.
class StringReplace {
public static void main(String args[]) {
String org = "This is a test. This is, too.";
String search
please explain me the flow of this program
please explain
me the flow of this program class Bticket extends Thread
{
Object train,comp;
Bticket(Object train,Object comp){
this.train=train;
this.comp=comp;
}
public void run(){
synchronized
Help me to write this simple java frame program
Help
me to write this simple java frame
program I want to write a Java
program for....
To create a frame with 4 text fields;name,street,city... and
when OK is clicked, corresponding values to be appeared.
let it appear
compile
compile how to
compile .class files using eclipse
resolution for prog
resolution for prog import java.lang.*;
class Current{
public static void main(String ar[]){
Thread t = Thread.CurrentThread();
System.out.println...();
^
1 error pls tell
me the reolution
java program for me to see who are on my server
java
program for
me to see who are on my server Hello,
Im a beginner in java, doing some tutorials and stuff.
I wanna write a java
program to put on my server where i wanna see if like 3 people are on my server PLUS that i want
please help me in coding this given program
please help
me in coding this given program consider the below... are the prime numbers in ascending order
write a
program to find the nth term in this series.
(i m unable to code this
program..please provide solution
please help me in coding this given program
please help
me in coding this given program consider the below... are the prime numbers in ascending order
write a
program to find the nth term in this series.
(i m unable to code this
program..please provide solution
please tell me the flow of execution of this program
please tell
me the flow of execution of this program class Test{
int x;
Test(int x){
this.x=x;
}
static void access(){
System.out.println("x= "+x);
}}
class Static{
public static void main(String ar[]){
Test obj=new Test(55