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 and s2. iv) To test if string s1 start with A. V) Extract substring from s3, starting from 5th to 10th

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  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  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  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
Quries
CHECK WHICH NO IS GREATER IN 4 NO'S
CHECK WHICH NO IS GREATER IN 4 NO'S  MAKE A PROGRAM TO CHECK WHICH NO. IS GREATER IN 4 NO'S IN JAVA ???   **class u... chaudhary(+919261377137) if you want to ask any quries then contact me or email
java
java  diff bt core java and java
java
java  what is java
JAVA
JAVA  how the name came for java language as "JAVA
java
java   why iterator in java if we for loop
java
java  explain technologies are used in java now days and structure java
java
java  different between java & core java
Java
Java   Whether Java is pure object oriented Language
java
java  is java open source
java
java  what is java reflection
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
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  give a simple example for inheritance in java
java
java  give a simple example for inheritance in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java   What is ?static? keyword
java
java  RARP implementation using java socket
java
java  sample code for RARP using java
java
java  Does java allows multiline comments
Java
Java  how to do java in command prompt
java
java  Write a java code to print "ABABBABCABABBA
java
java  write a program in java to acess the email
java
java  send me java interview questions
java
java  how use java method
java
java  what are JAVA applications development tools
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  is java purely object oriented language
java
java  why multiple inheritance is not possible in java
java
java  explain object oriented concept in java
java
java   difference between class and interface
Java
Java  how to draw class diagrams in java
java
java  write a java program using filenotfoundexception
java
java  hi im new to java plz suggest me how to master java[email protected]
java
java   How to set java Policy for applet using jdk 6
java
java pattern code for a given words  java pattern code for a given words pattern
java
java  dear, i want a field for date picker using java/java script
java
java  create java program for delete and update the details,without using database, just a normal java program
java
java  why methods in java raise exceptions   Have a look at the following link: Java Exceptions

Ads