Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: String Exercise 2 - Answers

Assume the following:> String s, t, h, a; String n, e

Tutorial Details:

Assume the following:> String s, t, h, a; String n, e; int i; h = "Hello"; s = " How are you? "; a = "abc"; n = null; e = "";


Give the values of the following expressions, or illegal.

1 5 h.length()
2 ello h.substring(1)
3 HELLO h.toUpperCase()
4 hello h.toUpperCase().toLowerCase()
5 0 h.indexOf("H")
6 false h.startsWith("ell")
7 1 "Tomorrow".indexOf("o")
8 3 "Tomorrow".indexOf("o", 3)


 

Rate Tutorial:
http://www.roseindia.net/java/java-tips/data/strings/q-fi-string-exercises/26stringexans.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
String Exercise 2 - Answers

View Tutorial:
String Exercise 2 - Answers

Related Tutorials:

The battle of the container frameworks: which should you use? - JavaWorld - January 1999
The battle of the container frameworks: which should you use? - JavaWorld - January 1999
 
Java Tip 71: Use dynamic messaging in Java - JavaWorld - April 1999
Java Tip 71: Use dynamic messaging in Java - JavaWorld - April 1999
 
Design networked applications in RMI using the Adapter design pattern
Design networked applications in RMI using the Adapter design pattern
 
Speed up listener notification - JavaWorld February 2000
Speed up listener notification - JavaWorld February 2000
 
StringBuffer versus String - JavaWorld March 2000
StringBuffer versus String - JavaWorld March 2000
 
Create dynamic images in Java servlets - JavaWorld May 2000
Create dynamic images in Java servlets - JavaWorld May 2000
 
Mapping XML to Java, Part 2 - JavaWorld October 2000
Mapping XML to Java, Part 2 - JavaWorld October 2000
 
Design for performance, Part 1: Interfaces matter - JavaWorld January 2001
Design for performance, Part 1: Interfaces matter - JavaWorld January 2001
 
Design for performance, Part 2: Reduce object creation - JavaWorld February 2001
Design for performance, Part 2: Reduce object creation - JavaWorld February 2001
 
Device programming with MIDP, Part 3 - JavaWorld July 2001
Device programming with MIDP, Part 3 - JavaWorld July 2001
 
Flex your grid layout
Flex your grid layout
 
Use XML data binding to do your laundry
Use XML data binding to do your laundry
 
XML documents on the run, Part 2
XML documents on the run, Part 2
 
A recipe for cookie management
A recipe for cookie management
 
Eclipse casts shadows
Eclipse casts shadows
 
Put Java in the fast lane
Put Java in the fast lane
 
Java Tip 132: The taming of the thread
Java Tip 132: The taming of the thread
 
Classifier4J
Classifier4J is a Java library designed to do text classification. It comes with an implementation of a Bayesian classifier, and now has some other features, including a text summary facility.
 
From Writing Programs to Creating Compilers
From Writing Programs to Creating Compilers In this article we build a simple compiler that augments Java with tasks (independent blocks of code that execute in parallel), thus creating a new language called AJ that well supports the programming of syste
 
JFormula 2.9 - Math expression API
JFormula 2.9 - Math expression API JFormula is a Java library for evaluating various expressions (boolean, math, if/then/else...). A lot of companies chose JFormula like EADS Space Transportation.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.