Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

  Take Quiz (Monsoon) Beta Version !!
  Do You have Qs. in your Mind ??? Ask it as Qs. or MCQs or create it as polling Live Now !!
Program Discussion :: Basics
Home > Programs > Basics

1. Write a program to print next to the last word of a sentence.

Answer:

<p>import java.io.BufferedReader;<br />
import java.io.IOException;<br />
import java.io.InputStreamReader;</p>

<p>public class StringWordIBM <br />
{</p>

<p>  Â  public static void main(String[] args) throws IOException <br />
  Â  {<br />
  Â  Â  Â  BufferedReader br = new BufferedReader(new InputStreamReader(System.in));<br />
  Â  Â  Â  String str;<br />
  Â  Â  Â  System.out.println("Enter the String : ");<br />
  Â  Â  Â  str=br.readLine();<br />
  Â  Â  Â  System.out.println(str);<br />
  Â  Â  Â  String s[] = str.split(" ");<br />
  Â  Â  Â  System.out.println("Splitted string : ");<br />
  Â  Â  Â  for(int i=0;i<s.length;i  )<br />
  Â  Â  Â  {<br />
  Â  Â  Â  Â  Â  System.out.println(s[i]);<br />
  Â  Â  Â  Â  Â Â <br />
  Â  Â  Â  }<br />
  Â  Â  Â  System.out.println("Second Last word of String is : " s[s.length-2]);<br />
  Â  }<br />
  Â Â <br />
}</p>

Asked In ::  IBM   TCS  

Post Your Answer Here:

Name *
Email

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: