Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners compile this program and let me know the resolution
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


kalyanitokuri
compile this program and let me know the resolution
1 Answer(s)      3 years and 11 months ago
Posted in : Java Beginners


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


Advertisement
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
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
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
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... do I compile and run this file using the terminal of ubuntu... By the way, I am
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
compile
compile  how to compile .class files using eclipse
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
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
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
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
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
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
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.   
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
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
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
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!   Finally find it on the apple website... The iPad display has a screen resolution
what is the resolution for the bellow error?
what is the resolution for the bellow error?  pe Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException
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
plz help me find a program
plz help me find a program  plz help..i want a source code in jsp for order processing
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
How to compile and run the JSP
How to compile and run the JSP  Hi Kindly tell me how to run and compile JSP small Program using Tomcat as webserver. I created small program HELLO JSP in HTML and compile the program but it is saying Class o r interface
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
Advertisements
 

 

 

DMCA.com