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




Have Programming Question? Ask it here!
 
 
 


guddu
java code
1 Answer(s)      3 years and 8 months ago
Posted in : Java Beginners


input any word ie risk,resul is--

r ri ris risk


Advertisement
View Answers

January 4, 2011 at 6:01 PM


Hi Friend,

Try the following code:

import java.util.*;
class  StringExample3
{
    public static void main(String[] args) 
    {
        Scanner input=new Scanner(System.in);
        System.out.print("Enter word: ");
        String st=input.next();
        for(int i=0;i<=st.length();i++){
            int j=i+1;
            System.out.println(st.substring(0,i));
        }
    }
}

Thanks



Related Tutorials/Questions & Answers:
java code
java code  what is the code to turn off my pc through java program
java code
java code  hi any one please tell me the java code to access any link i mean which method of which class is used to open any link in java program
Advertisements
java code
java code  I am beginer in java my question is how can i fill data from mysql database to jcombobox using netbeans
java code
java code  Write a program to find the difference between sum of the squares and the square of the sums of n numbers
java code
java code   Develop a program that accepts the area of a square and will calculate its perimeter
java code
java code  Develop the program calculateCylinderVolume., which accepts radius of a cylinder's base disk and its height and computes the volume of the cylinder
java code
java code  Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder
java code
java code  An old-style movie theater has a simple profit program. Each customer pays $5 per ticket. Every performance costs the theater $20, plus $.50 per attendee. Develop the program calculateTotalProfit that consumes
java code
java code  Develop the program calculateHeight, which computes the height that a rocket reaches in a given amount of time. If the rocket accelerates at a constant rate g, it reaches a speed of g ยท t in t time units and a height
java code
java code  Utopias tax accountants always use programs that compute income taxes even though the tax rate is a solid, never-changing 15%. Define the program calculateTax which determines the tax on the gross pay. Define
java code - Java Beginners
java code  how to check the locks on files on solaris server?can you please provide java code
Java Code - Java Beginners
Java Code  Code a statement that assigns the value ?Star Wars? to the first element of an array of strings named titles
java code - Java Beginners
java code  can u plz provide source code for the mini project of "online course portal for a campus
Java Code - Java Beginners
Java Code  Code a statement that assigns the value ?Star Wars? to the first element of an array of strings named titles
Java code - Java Beginners
Java code   Write a Java Program using Swings that displays image on JPanel on JFrame and apply various effects to that image Like Fading,Moving,Cutting
java code - Java Beginners
java code  i have one requirement , i have long value is 150.000- so i neeed to display(convert) as -150.000 using java language,please if u know the anwer send the code
Java Code - Java Beginners
Java Code  Hi all, I need to copy the contents and subfolders in a particular folder to the other folder using java... Can any one help me with the code... Thanks in advance
Java Code - Java Beginners
Java Code  hi all, i want the code for integrating with a circuit using network. pls help me to study the same
java code - Java Beginners
java code  Hi !I have already built a program for chatting (with GUI's ),but it works only with single client and single server.Can you please send me a java code for chatting which works with multiple clients an single server
JAVA code - Java Beginners
JAVA code   I want to create an indexed output file that I can read, update records, add records to, and delete records from. I cannot determine the JAVA code to do that. Does anyone have an example
Java Code - Java Beginners
Java Code  Given a one-dimensional array named monthSales with 12 double values, code a for loop that calculates the total of all the sales and stores it in a variable named yearSales
Java Code - Java Beginners
Java Code  Given a one-dimensional array named monthSales with 12 double values, code an enhanced for loop that calculates the total of all the sales and stores it in a variable named yearSales
Java Code - Java Beginners
Java Code  Code a statement that creates an array of doubles named miles and assigns the values 27.2, 33.5, 12.8, and 56.4 to its elements.  Double miles = new Double{27.2,33.5,56.4
Java Code - Java Beginners
Java Code  Code a statement that assigns a Customer object to the third element of an array of Customer objects named customers. Assume that the Customer class contains a constructor that assigns default values to all
Java Code - Java Beginners
Java Code  Code a statement that assigns a Customer object to the third element of an array of Customer objects named customers. Assume that the Customer class contains a constructor that assigns default values to all
Java Code - Java Beginners
Java Code  Given a one-dimensional array named monthSales with 12 double values, code an enhanced for loop that calculates the total of all the sales and stores it in a variable named yearSales
Java Code - Java Beginners
Java Code  Given a one-dimensional array of strings named ratings, code a statement that uses the fill method of the Arrays class to assign the value ?Not rated? to each element of the array
Java Code - Java Beginners
Java Code  Given a one-dimensional array of doubles named mileages, code a statement that uses the fill method of the Arrays class to assign the value 25.0 to the first 6 elements of the array
Java Code - Java Beginners
Java Code  Given a one-dimensional array of doubles named mileages, code a statement that uses the fill method of the Arrays class to assign the value 25.0 to the first 6 elements of the array
Java Code - Java Beginners
Java Code  Given a one-dimensional array of strings named ratings, code a statement that uses the fill method of the Arrays class to assign the value ?Not rated? to each element of the array
Java Code - Java Beginners
Java Code  Code a statement that assigns a Customer object to the third element of an array of Customer objects named customers. Assume that the Customer class contains a constructor that assigns default values to all
Java Code - Java Beginners
Java Code  Code a do while loop that continues executing until the value of a string variable named code is equal to ?X? or ?x?. Within the loop, display the prompt ?Enter a code or ?x? to exit: ?. Then, accept the value
java code - Java Beginners
java code  how can we convert an RGB image into its grayscale representation?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/color-effect-image.shtml The code, you
java code - Java Beginners
java code  sir i want to connect all m pages as i make a start button in swing and i want whn we click on start my login page is come next how we link the pages..plzz send me the code
java code - Java Beginners
java code  how to print stars like this * * * * *  Hi Friend, Try the following code: class Stars{ public static void main(String[] args) { System.out.println("*"); for(int i
Java Code - Java Beginners
Java Code  Code a statement that creates an array of doubles named...(" " + num[i]); } } } For more example on Java visit to : http://www.roseindia.net/java/ Thanks
java code - Java Beginners
java code  PROGRAM FOR RIGHT ALIGNMENT i.e INPUT: Enter any sentence: "This is JAVA" (which is displaying on the left side in the console i.e on cmd prompt) OUTPUT: "This is JAVA" (should
java code - Java Beginners
java code   dear i need one java code display 2d array with one loop dosent use two loops but use any one loop mens do while.../java/ Thanks
Java Code - Java Beginners
Java Code  Given a one-dimensional array of doubles named mileages, code a statement that uses the fill method of the Arrays class to assign the value 25.0 to the first 6 elements of the array.  Hi friend, Code
Java Code - Java Beginners
Java Code  Given an array of strings named vendors, code a statement that uses the sort method of the Arrays class to sort the elements in alphabetical order.  Hi friend, Code to sort the elements in alphabetical
Java code - Java Beginners
Java code  Java program to sort 'n' numbers using array  Hi Friend, Try the following code: public class SortArrayWithoutUSingMethod{ public static void sortArray(int array[], int len){ for (int i = 1; i
Java code - Java Beginners
Java code  Hello All, I need a code to convert the xml file to text file using Java   Hi Friend, Try the following code: import java.io.*; import org.w3c.dom.*; import javax.xml.parsers.*; import
java code - Java Beginners
or into microsoft power point using java?????plzzz insert its java code...java code  there is an error like the headerfiles does not exists(poi header files)...when i compiled insertingTextInShape.java.....what should i do
java code - Java Beginners
java code   i want code of combo box,that is ,if i select county ,then it has to display all the states name by using jsp  Hi Friend, Try the following code: 1)country.jsp: var xmlHttp var
Java Code - Java Beginners
Java Code  Code a private static method named printMessage that accepts a String parameter that represents the message. The method should simply...?.   Hi friend, Code Print the message : class MessagePrint
Java Code - Java Beginners
Java Code  Given two arrays named numbers1 and numbers2, code an if clause that tests if the two arrays are of the same type and have elements with the same values.  Hi friend, Code to tests if the two arrays
java code - Java Beginners
java code  write a program for immutable class  Hi Friend, Try the following code: final class ImmutableClass{ private final String product; private final double price; public ImmutableClass(String
Java Code - Java Beginners
Java Code  Code a statement that assigns the value ?Star Wars? to the first element of an array of strings named titles.  Hi friend, class ArrayStr { public static void main(String[] args) { String titles
Java Code - Java Beginners
Java Code  Code an application with a GUI that provides 3 menu options: 1: List Entries 2: Add Entries 3: Exit Prompt for an option If the user selects the first menu option, the application displays
Java Code - Java Beginners
Java Code  Code a for loop that adds the integers that are multiples of 5 starting with 50 and ending with 5. Each time the sum is increased, print it on a line at the console. Be sure to declare and initialize any required
Advertisements
 

 

 

DMCA.com