answersLogoWhite

0

The same way you would in a regular java program.

int i = 10;

String s = i + "";

after the above line of code the variable s will have "10" as a string value...

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Basic Math

How to write a Sql query to remove decimal point in a number?

To remove the decimal and numbers:select Convert(int,12.456)To keep the numbers after the decimal but remove the ".":select convert(int,convert(money,12.456)*1000)


What are jsp actions?

JSP actions are XML tags that direct the server to use existing components or control the behavior of the JSP engine. JSP Actions consist of a typical (XML-based) prefix of "jsp" followed by a colon, followed by the action name followed by one or more attribute parameters. There are six JSP Actions: < jsp : include / > < jsp : forward / > < jsp : plugin / > < jsp : usebean / > < jsp : setProperty / > < jsp : getProperty / >


Write a jsp program to find Maximum of 3 numbers?

To find the maximum of three numbers using JSP, you can create a simple form to accept three numbers as input. Upon form submission, you can use JSP scriptlets to compare the numbers and determine the maximum. Here’s a basic example: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head> <title>Find Maximum of Three Numbers</title> </head> <body> <form method="post"> Number 1: <input type="number" name="num1"><br> Number 2: <input type="number" name="num2"><br> Number 3: <input type="number" name="num3"><br> <input type="submit" value="Find Maximum"> </form> <% String num1Str = request.getParameter("num1"); String num2Str = request.getParameter("num2"); String num3Str = request.getParameter("num3"); if (num1Str != null && num2Str != null && num3Str != null) { int num1 = Integer.parseInt(num1Str); int num2 = Integer.parseInt(num2Str); int num3 = Integer.parseInt(num3Str); int max = Math.max(num1, Math.max(num2, num3)); out.println("Maximum number is: " + max); } %> </body> </html> This program displays a form to input three numbers and outputs the maximum number after submission.


What does jsp mean?

jsp means Java Server Pages.


How do you select a substring from a string using PHP?

In php to select a sub string from a string, use the command: string substr ( string string, int start [, int length]);Simple Examples:

Related Questions

How do you convert string to int in Java?

One can convert a string variable to an int variable in Java using the parse integer command. The syntax is int foo = Integer.parseInt("1234"). This line will convert the string in the parenthesis into an integer.


How do you convert string to int in net?

int i= Convert.ToInt32("5");


How can you convert from int to string?

There is no one line of code that can convert an array to a different type. A new String array would have to be created and values individually inserted into the array. Example: //Assume int[] i has been previously defined String[] s = new String[i.length]; for(int i=0; i<s.length; i++) s[i] = ""+i[i];


How can someone convert string to int in Java?

To convert string to int in Java, the easiest way is to simply use the method Integer.parseInt(). For more information how to do this, refer to the integer class documents.


How you can convert from string to int in C language?

Use the atoi() or atol() function.


How do you convert integer array to string array in c?

To convert an integer array to a string array in C, you can use the sprintf function within a loop to format each integer as a string. First, create a string array with enough space to hold the string representations. Then, iterate through the integer array, using sprintf to convert each integer to a string and store it in the corresponding index of the string array. Here's a simple example: #include <stdio.h> void intArrayToStringArray(int *intArray, char stringArray[][12], int size) { for (int i = 0; i < size; i++) { sprintf(stringArray[i], "%d", intArray[i]); } }


How do you convert an integer int a string through parsing?

int <integerName> = <integerValue>; String <StringName> = Integer.toString(<integerName>); /*where integerName is the name of the integer value, integerValue is the assigned value of the integer, and where StringName is the name of the string holding the parsed integer. */


How do you enter integer in python?

In Python, you can enter an integer using the input() function, which captures user input as a string. To convert this string to an integer, you can use the int() function. For example: user_input = input("Enter an integer: ") integer_value = int(user_input) This will convert the input string to an integer, assuming the user enters a valid integer.


How do you convert an integer to a string?

That really depends on the programming language. In Java, it is sufficient to concatenate it with a String: int myNumber = 5; result = "" + myNumber; Other languages may require a special function, or method, to convert from integer to string.


How do you convert a scanner to string in java?

I assume that your scanner is not scanning a string already, so if you are scanning an int then you can do: for the example you scanner variable is x .... x.intparseString();


How can you convert from int to string in NET?

lets say you have the following: Dim Int1 as Integer=12 Dim String1 as String 'Very Simple String1=Int1.tostring


How do you change string in integer?

To convert a string to an integer in Python, you can use the int() function. For example, num = int("123") will change the string "123" into the integer 123. If the string cannot be converted (e.g., it contains non-numeric characters), a ValueError will be raised. Always ensure the string represents a valid integer before conversion to avoid errors.