Pregunta de entrevista de IDZ Digital

Reverse the string

Respuestas de entrevistas

Anónimo

30 de jul de 2019

import java.util.*; public class Reverse { public static void main(String[] args) { System.out.println("Enter the word"); Scanner sc=new Scanner(System.in); String word=sc,nextLine(); String eeverse=""; for(int i=word.length()-1;i>=0;i--) { reverse=reverse+""+charAt(i); } System.out.println(reverse); } }

1

Anónimo

21 de may de 2019

Java:- String reverse = new StringBuffer().reverse().toString() Sop(reverse) Remember you have take string input from user and assign to a variable then pass the variable to string buffer object Eg: reverse(a)

Anónimo

30 de jul de 2019

import java.util.*; public class Reverse { public static void main(String[] args) { System.out.println("Enter the word"); Scanner sc=new Scanner(System.in); String word=sc,nextLine(); String eeverse=""; for(int i=word.length()-1;i>=0;i--) { reverse=reverse+""+word.charAt(i); } System.out.println(reverse); } }