Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


chandru
Java Quries
1 Answer(s)      3 years and 3 months ago
Posted in : Java Beginners


a java program to create String s1="?Abook on java"? s2="?Ilike it", s3="Dreamtech press" and perform the following operations. i) Display all the 3 strings. ii) Find the length of s2 and s3.7 Iii) Concat s1 and s2. iv) To test if string s1 start with A. V) Extract substring from s3, starting from 5th to 10th


Advertisement
View Answers

August 2, 2011 at 11:18 AM


class StringExample
{
    public static void main(String[] args) 
    {
        String s1="Abook on java";
        String s2="Ilike it";
        String s3="Dreamtech press";

        System.out.println("First string is: "+s1+" second string is: "+s2+" and third string is: "+s3);
        System.out.println("Length of s2: "+s2.length());
        System.out.println("Length of s3: "+s3.length());
        String concatenatedString=s1.concat(s2);
        System.out.println("Concatenated String: "+concatenatedString);
        if(s1.startsWith("A")){
            System.out.println("String s1 starts with A");
        }
        else{
            System.out.println("String s1 does not start with A");
        }
        String substring=s3.substring(5,10);
        System.out.println("Substring of string s3: "+substring);
    }
}


Related Tutorials/Questions & Answers:
Java Quries
Java Quries  a java program to create String s1="?Abook on java"? s2="?Ilike it", s3="Dreamtech press" and perform the following operations. i) Display all the 3 strings. ii) Find the length of s2 and s3.7 Iii) Concat s1
Quries
Quries  a JAVA program to calculate the percentage of a student marks by using java arithmetic operators like +(addition), % (division
Advertisements
Quries
Quries  a JAVA program which shows how to declare and use STATIC member variable inside a JAVA class.   Please visit the following link: Static Variable Example
Quries
Quries  Java Program To accept different types of inputs in aline at atime from the keyboard (like name,age,salary,gender) just like one can do using scanf() in c(using StringTokenizer
Quries
Quries  a JAVA program to create an array of size 10 (Integer Values) by taking input from BufferReader and find out the average value of array elements from that array
Quries
Quries  Program java For menu driven application to store the details of books based on the course(MBA, MSc ,MA) as a choice and display the list of corresponding course books9Min 5 books for each course. 1. MBA 2. MCA 3. MSc 4
Quries
Quries  Write a JAVA program to get current date and time in the following format :, Current Year is : 2007, Current Month is : 12, Current Date is : 25, Current Hour in 12 hour format is : 6, Current Hour in 24 hour format
sql quries
sql quries  i want basic sql quries please provide
java
java  diff bt core java and java
java
java  what is java
Java
Java   Whether Java is pure object oriented Language
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
java
java  is java open source
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
java  write a java program using filenotfoundexception
Java
Java  how to draw class diagrams in java
java
java   difference between class and interface
java
java  why multiple inheritance is not possible in java
java
java  explain object oriented concept in java
java
java  is java purely object oriented language
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  what are JAVA applications development tools
java
java  how use java method
java
java  send me java interview questions
java
java  write a program in java to acess the email
 

 

 

DMCA.com