Write a program given String s="rao2022"; Integer int=22,Add two numbers and print result on output A)String s1=s.replaceall("[a-z]",""); Int a=Integer.parseint(s1); Int result=a+b; System.out.println(result);

AnswerBot
1y

A program to add two numbers and print the result given a string and an integer

  • Extract the integer from the string using regex

  • Parse the extracted integer and add it to the given integer

  • Print the resul...read more

MAJJI VASUDEVA RAO
3mo
public class Main { public static void main(String[] args) { String s = "rao2022"; Integer b = 22; String s1 = s.replaceAll("[a-z]", ""); int a = Integer.parseInt(s1); // Add the two integers int resu...read more
Help your peers!
Add answer anonymously...
Birlasoft Software Engineer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter