package com.altafjava.test;
public class Test {
public static void main(String[] args) {
String s="526";
int sum=0;
for(int i=0;i<s.length();i++){
sum=(sum*10)+(s.charAt(i)-48);
}
System.out.println("Original string = "+s);
System.out.println("Converted integer = "+sum);
}
}
RECENTLY MOST VIEWS
MOST POPULAR
-
Note: A number will be called DISARIUM if sum of its digits powered with their respective position is equal to the original number. For e...
-
The International Mobile Station Equipment Identity(IMEI) is a number, usually unique, to identify mobile phones, as well as some satellit...
-
Harshad Number : In recreational mathematics, a Harshad number (or Niven number), is an integer (in base 10) that is divisible by the sum ...
-
package com.altafjava.sln.test; public class SecondLargestNumber { public static void main(String[] args) { int[] arr={5,20,8,1...
-
package com.fdcis.test; /** * How to find duplicate characters in a string in java? * */ public class Test { public static v...
Blog Archive
-
▼
2018
(38)
-
▼
August
(19)
- How to convert string into int primitive data type?
- Write a JAVA program for the given string and take...
- How to find largest number less than a given numbe...
- How to count occurrences of each character of a st...
- How to count occurrences of each character of a st...
- How to find second largest number in an integer ar...
- How to find sum of all digits of a number in java?
- How to find duplicate elements in an array using H...
- How to find duplicate elements in an array?
- Java Program to check two strings are Anagram or not
- How do you check the equality of two inner arrays ...
- How do you check the equality of two arrays in java?
- How to count duplicate characters in a string in j...
- How to find duplicate characters in a string in java?
- How do you remove all white spaces from a string i...
- How do you remove all white spaces from a string i...
- How to print Number Pyramid Pattern in java?
- How to create a pyramid of numbers in java?
- How to reverse a string in java?
-
▼
August
(19)
About
Hello ALTAF
All Java Interview Programs
convert-string-to-int
How to convert string into int primitive data type?
Friday, August 24, 2018
Subscribe to:
Post Comments (Atom)
Program List
- armstrong
- char-occurrances
- check-anagram
- check-duck-no
- check-duplicate-no
- check-endianess-of-os
- check-equality-of-two-arrays
- check-fibonacci-series
- check-harshad-no
- check-kaprekar
- check-keith-no
- check-niven-no
- check-palindrome
- check-prime
- check-prime-no
- check-substring
- check-unique-no
- check-valid-imei
- convert-array-to-list
- convert-string-to-int
- count-duplicate-char-in-string
- count-occurrences-char-of-string
- create-immutable-class
- disarium
- filter-number
- find-1st-non-repeat-char
- find-common-no-in-array
- find-duplicate-char-in-string
- find-duplicate-no-in-array
- find-largest-no-less-than-given-no
- find-palindrome
- find-second-largest-number
- image-store-in-database
- jdbc-program
- number-pyramid-pattern
- numeric-pattern
- remove-duplicate-in-string-array
- remove-white-space-of-string
- reverse-list
- reverse-string
- search-element-in-array
- search-list
- sorting-array
- sorting-list
- sorting-user-defined-object
- string-reverse
- sum-of-all-digits
- swap-2-no
- view-system-properties
0 Comment to "How to convert string into int primitive data type?"
Post a Comment