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 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









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  
Please check it and let me know - Java Beginners
Please check it and let me know  Hi friends, your las suggession is not ok becoz this code give some error and problem,Today i m sending all code and requirement please check it and solve again thanks Requirements:- I
Advertisements
Is the logic correct to detect IE version..plz let me know
Is the logic correct to detect IE version..plz let me know  <html> <head> <script type="text/javascript"> function...;/head> <body> <form> <input type="button" value="Click me
hi,i'am new to Jsp.Can some one please let me know an answer for this question?
hi,i'am new to Jsp.Can some one please let me know an answer for this question?  how do we upload an xml file and validate them against WIPO DTD
compile and run java program
compile and run java program  Hello, everyone!!! I just want to ask if you anyone here knows how to compile java file in linux specifically UBUNTU..._TO_REPLACE_1 how do I compile and run this file using the terminal of ubuntu
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select length(ename)||' charecters exist in '||initcap(ename)||'s name' as "names and length" from emp
i have problem with this query... please tell me the resolution if this .........
i have problem with this query... please tell me the resolution if this .........  select initcap(ename),job from emp where substr(job,4,length(job,4,3)))='age
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
provide me the program for that ques.
provide me the program for that ques.  wtite a program in java there is a class readchar.the functionality of this class is to read a string from the console and display the characters of that string on the console.   
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
Clear Question plz et me know immediately - Java Beginners
Clear Question plz et me know immediately   Hi Deepak your application is good,pls modify this application and let me know My problem is that, Steps: 1:- A form have three 3 button delete,insert,edit. 2
i got an error while compile this program manually.
i got an error while compile this program manually.  import javax.servlet.http.*; import org.apache.struts.action.*; public class ActionOne{ public ActionForward execute(ActionMapping mapping
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
please let me get code how to insert a data to mysql using setter and getter method by using java
please let me get code how to insert a data to mysql using setter and getter method by using java  please let me get code how to insert a data to mysql using setter and getter method by using java pelease let me have the code
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
How to Develop, Compile & Run a rmi Program in NetBeans 6.9.1 ide?
How to Develop, Compile & Run a rmi Program in NetBeans 6.9.1 ide?  how to develop, compile & run a rmi program in netbeans 6.9.1 ide? will you please give me a step by step (practical) explaination? Thanks in advance
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
compile
compile  how to compile a java program using jre7
Example to compile a java file with the help of the program
Example to compile a java file with the help of the program... are describing you the way to compile the java file with the help of the java program. The steps involved for compiling the java file from the program are described
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
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
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
compile
compile  how to compile .class files using eclipse
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
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
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 for this program - Java Beginners
please help me for this program   Write a program that asks the user for a starting value and an ending value and then writes all the integers (inclusive) between those two values. Enter Start: 10 Enter End: 14 10
plz explain me the output of program - Java Beginners
plz explain me the output of program  Hi friends, can u please explain me the output of below program with proper explanation of each and every line...;Hi Friend, Output of this program is: a=2 b=0 c=0 mul=27 volume=18
Java compile error - Java Beginners
Kindly let me know what is the problem? Secondly, do you know any easy method to compile Java on Mac besides using the Terminal...Java compile error  I am having trouble compiling the Java project
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 2 1 1 3 4 3 1 1 4 7 7 4 1
please help me to write a code for this program
please help me to write a code for this program   1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
plese tell me the control flow of this program
plese tell me the control flow of this program  public class starForTest { public static void main(String [] args) { for (int... k....? plese tell me the control flow
please help me in a java program !! - Java Beginners
please help me in a java program !!  the porgram should use...://en.wikipedia.org/wiki/Kosaraju_algorithm) there are 4 classes in my program : Vertex... and run the program" i still need to modify the method kosaraju in the class Graph
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
please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three buttons: ?Fruit?, ?Bird? and ?Animal? Step 2: On clicking ?Fruit? button
tell me i don't know about cms and history - Java Interview Questions
tell me i don't know about cms and history  what is cms,when can it is used ,what are the advantages and what are the more information about CMS
please eslain me the flow of execution of this program
please eslain me the flow of execution of this program  class Producer extends Thread { StringBuffer sb; boolean dataprodover = false; Producer(){ sb = new StringBuffer(); } public void run(){ for(int i=1;i<=10;i++){ try
Problem coming up with program? Do not know where to start!
Problem coming up with program? Do not know where to start!  Write a program to simulate 1000 trials, each of which consists of tossing a fair coin... program should print the proportion of trials resulting in exactly n heads
Problem coming up with program? Do not know where to start!
Problem coming up with program? Do not know where to start!  Write a program to simulate 1000 trials, each of which consists of tossing a fair coin... program should print the proportion of trials resulting in exactly n heads
Problem coming up with program? Do not know where to start!
Problem coming up with program? Do not know where to start!  Write a program to simulate 1000 trials, each of which consists of tossing a fair coin... program should print the proportion of trials resulting in exactly n heads
help to write a program for biology to know if two person are related or not
help to write a program for biology to know if two person are related or not   I wrote the program and i want some help pleas this program check... in 2d array but i have wrote program to sum the ones each rows and compared
resolution problem in java
resolution problem in java  I designed project in java in my PC when run the same project in some other PC i can't fully view my java forms.Some said that it is resolution problem
ModuleNotFoundError: No module named 'django-variable-resolution-date'
ModuleNotFoundError: No module named 'django-variable-resolution-date'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'django-variable-resolution-date' How to remove
ModuleNotFoundError: No module named 'entity-resolution-evaluation'
ModuleNotFoundError: No module named 'entity-resolution-evaluation'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'entity-resolution-evaluation' How to remove
ipad screen resolution pixels
ipad screen resolution pixels  Hi! Can you tell the exact size of the iPad in pixels ..including height & width. Thanks Very Much!   ... a screen resolution of .. 1024×768 pixels other details..ADS_TO_REPLACE_2

Ads