Welcome to the world of Java! In this challenge, we practice printing to stdout.
The code stubs in your editor declare a Solution class and a main method. Complete
the main method by copying the two lines of code below and pasting them inside the
body of your main method.
[Link]("Hello, World.");
[Link]("Hello, Java.");
Input Format
There is no input for this challenge.
Output Format
You must print two lines of output:
1. Print Hello, World. on the first line.
2. Print Hello, Java. on the second line.
Sample Output
Hello, World.
Hello, Java.
Solution:
public class Solution {
public static void main(String[] args) {
[Link]("Hello, World.");
[Link]("Hello, Java.");
A palindrome is a word, phrase, number, or other sequence of characters which reads
the same backward or forward.(Wikipedia)
Given a string , print Yes if it is a palindrome, print No otherwise.
Constraints
will consist at most lower case english letters.
Sample Input
madam
Sample Output
Yes
Soution’
import [Link].*;
import [Link].*;
public class Solution {
public static void main(String[] args) {
Scanner sc=new Scanner([Link]);
String A=[Link]();
boolean isTrue = true;
int i = 0;
int j = [Link]()-1;
while (i<j)
if([Link](i) != [Link](j))
isTrue = false;
i++;
j--;
if(isTrue)
[Link]("Yes");
else
[Link]("No");
/* Enter your code here. Print output to STDOUT. */