Home Tutorialhelp Comment program query

 
 

Comment

sandip kanzariya
program query,
January 25, 2008 at 1:50 PM

This is the program of simple calculator.
Here i am using '+','-','*','/'.

/********code of program****/


class SimpleCal
{
public static void main(String a[])
{
String c=a[0];
char choice=c.charAt(0);
int i=Integer.parseInt(a[1]);
int j=Integer.parseInt(a[2]);
int ans;
switch(choice)
{
case'+':
ans=i+j;
System.out.println(ans);
break;
case'-':
ans=i-j;
System.out.println(ans);
break;
case'*':
ans=i*j;
System.out.println(ans);
break;
case'/':
ans=i/j;
System.out.println(ans);
break;
}

}
}

/*********problem**********/

If we use * operator, it is not working.
ex:- java * 5 2

If we use "*" operator, it is working and give output.
So,is it any reason?

I think * is a special operator in java.
Reply me as soon as possible.

Thanks.....

View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

object conversion - Java Beginners
query, otherwise u may got help from here, http://www.roseindia.net/java/java-conversion/ObjectToDouble.shtml Thanks... sandeep kumar suman...object conversion   Hi, Can anybody tell me the object conversion 

Java Beginners

query
independent: You can write and compile the Java program and then run on any platform...query  what is jre????? why java is robust in nature??????? why it is platform independent???????   Hi, JRE: Java Runtime Environment 

Java Beginners

Language Conversion
Language Conversion  write a java program to convert "Hello World" in spanish 

UML Questions

hexadecimal conversion java compilation - UML
hexadecimal conversion java compilation  write a simple program..., Please visit the following links: http://www.roseindia.net/java/java-conversion/BinaryToHexa.shtml http://www.roseindia.net/java/java-conversion 

Java Beginners

Distance conversion - Java Beginners
Distance conversion  Write an application that reads a distance in metres. The program will then present a user menu of conversion types, converting..."); System.out.println("4. Quit the program"); System.out.println(); System.out.print 

Java Beginners

java conversion
java conversion  how do i convert String date="Aug 31, 2012 19:23:17.907339000 IST" to long value 

Java Beginners

java query
java query  why do we divide the number by 2 in for loop in the prime number program 

Java Beginners

Another distance conversion - Java Beginners
Another distance conversion  Write an application that reads a distance in metres. The program will then convert the distance to kilometres, feet... a method for each conversion ? toKilometres(), toFeet(), and toInches 

Java Beginners

java query
java query  **strong text**getting an error can not run symbol while running this program..plz help me... import java.util.Scanner; class Great { public static void main(String args[]) { int a; int b; int c; Scanner x 

Applet Questions

conversion Applet
conversion Applet  I am a java beginner.................. strong texthow to create JApplet that prompts the user to enter a distance in miles in a JTextField and then converts mile to kilometers and display the result as XX.XX 

Java Beginners

Java Conversion Question - Java Beginners
Java Conversion Question   Hello sir ,How i can Convert Java Code to Vb.net ,Plz Help Me 

Java Beginners

Query
Query  hw to transfer a file from one client machine to another client machine using java socket programming???? plz rpy soon..want to do project 

Java Beginners

Java Query - Java Beginners
Java Query  Q. Write a java program to read the an array's elements(not size fixed of an array) entered by user?  Hi Friend, Try the following code: import java.util.*; class InputArray{ public static void main 

Java Beginners

html2xml conversion
html2xml conversion  java code to convert html file to xml 

Java Beginners

Type Conversion - Java Beginners
for conversion 

Java Beginners

image conversion tools
image conversion tools  how many tools are available in image conversion at particularlly in java 

Java Beginners

Java Query - Java Beginners
Java Query  Q. Write a program to display on command prompt as if the user enters 123,it should be display in word like "One Hundred and Twenty Three"?  Hi Friend, Try the following code: import java.util. 

Java Beginners

form to java script conversion
form to java script conversion  I am using a form one more form cotain a piece of code . how to convert it to java script to function it properly? code is shown below <form action="http://www.google.com" id="cse-search 

Java Beginners

conversion - Java Beginners
 

Java Beginners

Excel conversion tool. - Java Beginners
Excel conversion tool.  Hi, I need a conversion tool which can convert .xls(Excel 2003) to .xlsx (Excel 2007) and vice-versa. Please suggest any links ro tools. Thank You 

General

Java Date Conversion
Java Date Conversion In java date conversion, two packages are used... seconds and even then only Java provides implementation that actually track leap... Java Converts String into Date In this example we are going to convert 

Java Beginners

Java To Vb.Net Conversion - Java Beginners
Java To Vb.Net Conversion  How to convert Java Code To VB.net,which Software is useful to convert java to vb.net,plz Help Me 

Development process Questions

Conversion - Development process
Conversion  Why is there a need to convert from Java to .NET? What is the theory of conversion from java to .NET? How it is done?   Hi... Conversion Assistant (JLCA). Code that calls Java APIs can convert to comparable C# code 

Java Beginners

java query
java query  what is the alternative of fflush(stdin) in java 

Java Beginners

java query
java query  why do we use scanner class 

Java Beginners

String to Date Conversion - Java Beginners
)); For read more information : http://www.roseindia.net/java/java-conversion...  Hi friend, For conversion in this format : 11/SEP/2008 07:07:32 

Java Beginners

PDF to Word Conversion - Java Beginners
PDF to Word Conversion  Hello, Can we convert a PDF document to Microsoft word document thru Java. If its not possible in Java, is it possible in any other language 

Java Interview Questions

Conversion In Collections - Java Interview Questions
Conversion In Collections  Hi Friends, can u give code to convert ArrayList to HashMap and HashMap to ArrayList. Thanks Prakash  Hi Friend, 1)Convert ArrayList To HashMap: import java.io.*; import java.util. 

Date Calendar

Java Date conversion - Date Calendar
Java Date conversion  How do I convert 'Mon Mar 28 00:00:00 IST 1983' which is a java.util.Date or String to yyyy/MM/dd date format in sql 

General

Java Conversion
Java Conversion      ... This is a simple program of java util.package. In this section, you will learn... the conversion of text into html file .This program functionally provides you converting 

Java Beginners

Reports to pdf conversion
Reports to pdf conversion  I need to convert reports into pdf format using java.. Will i get any sample code 

Hibernate Questions

Hibernate Criteria Query Example
Hibernate Criteria Query Example  Hi, How to create Hibernate Criteria Query Examples in Java program? Share me the easy to learn example code. Thanks   Hi, Hibernate Criteria Query is used to selectively find 

Java Beginners

pdf to xml conversion
pdf to xml conversion  i want to convert pdf file into xml file.. where i am having a table in pdf file with some headers and some data into it. i want the headers to be the tag of xml file. how can i do that using java? please 

Java Beginners

HSSFCell to String type conversion
://www.roseindia.net/tutorial/java/poi/readExcelFile.html 

Java Beginners

Conversion from color to Gray Image - Java Beginners
Conversion from color to Gray Image  Hi... Sakthi here.. i am new to java. and i haven't try this so far How to convert the color image to gray scale image in java? could u plz help me out to start the process 

Development process Questions

java code for conversion of arraylist to string - Development process
java code for conversion of arraylist to string  Hi, i have an arraylist contains [a,b,value,c,d,value]when ever value comes it will split into seperation.fo that i want to convert into string, after that split the string 

Development process Questions

query optimization
query optimization  hai ! i need a code in java for database query optimization.plz help 

Ajax Questions

Query on java - Ajax
Query on java  what is modal form 

Java Beginners

Java Query - Java Beginners
Java Query  Q.What is "Identifier Expected Error" in Java and when does it occur? Send me a list of causes related this error.  Hi Friend, This is the error that occurs during the compilation of a resource 

Java Beginners

Program - Java Beginners
for more information, http://www.roseindia.net/java/java-conversion/convert-number 

JSP Servlet Questions

query on java servlet
query on java servlet  hello sir,i am doing online exam using j2ee (i.e) with servlet and back end ms access just like statically after that i will use dynamic connection sir.what queries to be used for data base validation 

Java Tips and Examples

Conversion of Decimal to Binary in Java
Conversion of Decimal to Binary  in Java In this section we will discuss about conversion of Decimal to Binary in Java. You know that number having.... Now here is the code for conversion.  class Conversion { public static 

Java Beginners

java code for given query
java code for given query  i am not able to display to display graph in all browsers it is only displaying in ie using java 

Java Beginners

query String - Java Beginners
query String  Hi friends, I have some page and given link left side like master,utilities,reports,if i am clicking master then open master file... how i implemmented and write code and send send me, I using query string or any 

JSP Servlet Questions

Query
Query  how can i set path and Classpath or Environmental Variable for jsp/servlet program to compile and run 

Java Beginners

ascii to thai language conversion - Java Beginners
 

Java Beginners

program
program  write a program different between to dates in terms of days in java 

Java Beginners

Query - Java Beginners
? Parents = UPS UPM UPC UPE and Tutors = UPS and UPC I can't figure out the query for this till now and have been reading up JSTL and Msaccess query etc 

JSP Servlet Questions

query problem
query problem  how write query in jsp based on mysql table field? i have employee table it contain designation field, how write query in jsp... to write this query in jsp please anybody help me, and send me that code 

Java Beginners

java program for
java program for   java program for printing documents,images and cards 

Java Beginners

program
program  WAP a java program to form 1/2+3/4+5/6+7/8 series 

Java Beginners

bigdecimal in java query
bigdecimal in java query  Hello, I want to create a boolean method which compares two objects and returns true if equal. At the same time I want this method to compare the values of variables of the same objects and returns true 

Struts Questions

Query - Struts
Writing quires in Struts  How to write quires in Java Struts 

Swing AWT

Java Program
Java Program  A Java Program that print the data on the printer but buttons not to be printed 

Java Beginners

program
program  write a java program to input a no. and print wheather the no. is a special no or not. (special no. are those no whose factorial of the sum of digit of the no is same as the original 

Java Beginners

program
program  explanation of program on extending thread class   Hi Friend, Please go through the following link: Java Threads Thanks 

JavaScript Questions

javascript query
javascript query  how to get javascript variable value into java variable?? i have one value in javascript variable(var name = value ) i want this name variable value in java variable (string name1 

WebSevices Questions

query - WebSevices
Creating webservices for Java  What would be the best approach to create web services for Java 

Development process Questions

Java code for conversion between .xls and .xlsx or vice versa - Development process
Java code for conversion between .xls and .xlsx or vice versa  I've some problems in my Project. I'm working on a web based application which... or tool in Java for converting between .xls to .xlsx or Vice versa 

Struts Questions

jsp to struts 2 action conversion problem - Struts
jsp to struts 2 action conversion problem  i have one jsp page that includes 3 other jsp pages(using RequestDispactcher).how to convert that jsp...(i.e no java code is involved).remaining pages involve java code.  Hi 

Java Beginners

a Java program
a Java program    Write a Java program to print even numbers from 2 to 1024? Write a Java program to print ? My Name is Mirza? 100 times? Write a Java program to print Fibonacci Series? Write a Java program to reverse a number 

Java Beginners

project query
project query  I am doing project in java using eclipse..My project is a web related one.In this how to set sms alert using Jsp code. pls help me 

Applet Questions

Java image query from Rupesh
Java image query from Rupesh  who give web page link to any submenu in menu bar of screen in java so that after click on that submenu, this submenu direct link to web brower or web page 

PHP Questions

mysql query
with ("jdbc:odbc:excel"). Execute query "select name, address from [Sheet1$]". Here... database using the loops. For more illustration, we are providing you java example 

Java Interview Questions

java program
java program  write a program to print 1234 567 89 10 

Java3D Questions

Frame query
Frame query  Hi, I am working on Images in java. I have two JFrame displaying same image. We shall call it outerFrame and innerFrame.In innerFrame i am rotating the image.After all the rotations i need to display this image 

Java Beginners

program
program  i want a progra in java to print a sentence in alphabetic order, taking the input from the user.the program should writen without using the array for example : if input= this is a cat then output sould = a cat 

Java Beginners

java program
java program  Write a java program to find the number of Positive numbers in m* n matrix 

Java Beginners

Java Program
Java Program  java program to insert row in excel sheet after identifying an object 

Java Beginners

java program
java program  write a java program to display array list and calculate the average of given array 

Java Beginners

java program
java program  hi friends how to make a java program for getting non prime odd numbers in a given series 

Java Beginners

java program
java program  Write a java program to do matrix addition operation On two given matrices 

Applet Questions

java program
java program  Write a program to create an applet and display The message "welcome to java 

Java Beginners

java program
java program  java program to implement the reflection of a particular class details like constructor,methods and fields with its modifiers 

Java Beginners

java program
java program  write a java program to display array list and calculate the average of given array 

Java Beginners

java program
java program  write java program for constructor,overriding,overriding,exception handling 

Java Interview Questions

java program
java program  how to write an addition program in java without using arithematic operator 

Java Beginners

program - Java Beginners
program  a program to print 123454321 1234 4321 123 321 12 21 1 1  make sure about ur first line 123454321 or 1234554321   Hi punnet if query is correct then the code like 

Java Beginners

java program
java program  Write a program to demonstrate the concept of various possible exceptions arising in a Java Program and the ways to handle them.  ... in Java 

Hibernate-Tutorials

HQL, Hibernate Query Language
HQL - Hibernate Query Language In this tutorial on HQL we will learn how...? The HQL stands for Hibernate Query Language, which is inspired by the SQL... and it properties. The Hibernate Query Language is very powerful tool 

Java Beginners

Java Query(based on swing concept)
Java Query(based on swing concept)  I want a particular submit button to get disabled whenever i write some account number starting with 774 and 775 in a text box of that screen 

Java Beginners

java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding 

Java Beginners

java program
java program  write a java program to compute area of a circle.square,rectangle.triangle,volume of a sphere ,cylinder and perimeter of cube using method over riding 

Java Beginners

java program
java program   Write a program to find the difference between sum of the squares and the square of the sums of n numbers 

Java Beginners

java program
java program  write a program to create text area and display the various mouse handling events 

Java Beginners

Convert Miles To Kilometers program in java
. Extend your program to support conversion from kilometres to miles. Use an extra...Convert Miles To Kilometers program in java  Write a program... the table. The program should then print out a table of converted values to 2 decimal 

Java Beginners

Java program
Java program  How to write for drawing a face in java 

Java Beginners

Java program
Java program  How to write code in order to draw a face in java 

Java Beginners

Java program
Java program  How to write code in order to draw a face in java 

JavaScript Questions

java program
java program  wap to show concept of class in java 

JDBC Questions

How to make query and abstraction in Java
How to make query and abstraction in Java  Hi, I read the lessons... write. I am very beginner in Java I don't know anything in it. I am using PostgreSQL database, and I want to make a query and abstraction for a table. Could 

Applet Questions

java program
java program  i want a applet program that accepts two input strings using tag and concatenate the strings and display it in status window. please give mi he code for this in core java 

Applet Questions

java program
java program  i want a applet program that accepts two input strings using tag and concatenate the strings and display it in status window. please give mi he code for this in core java 

Applet Questions

java program
java program  i want a applet program that accepts two input strings using tag and concatenate the strings and display it in status window. please give mi he code for this in core java 

Java Beginners

Java Program
Java Program  I want to Write a program in JAVA to display to create a class called MATRIX using a two-dimensional array of integers. Perform the addition and subtraction of two matrices. Help me 

Regex Questions

java program
java program  write a java program to create an array of size 10 by taking input from bufferreader and find out the average of array elements from that array 

Regex Questions

java program
java program  write a java program to create an array of size 10 by taking input from bufferreader and find out the average of array elements from that array 

Java Beginners

java program
java program  write a java program to create an array of size 10 by taking input from bufferreader and find out the average of array elements from that array 

Java Beginners

java program
java program  write a java program to read a file which hold email address validate email address tohave formate @.* and replace all .com email address 

Java Interview Questions

program in java
program in java  write a reverse program in java using string buffer.the input and out put as follows. input- hi good mornig out put-ih doog ginrom 

Advertisements Advertisements
 

 

 

DMCA.com