//start uber 1337 haxxor Java program

import java.io.*;
 

  public class Stringprogram{
    public static void main (String args[]){
    String word1,upperCase,lowerCase;
    int numChar,lastChar,firstChar,secondChar;
    word1 = “computer”;
    numChar = word1.length();
    upperCase = word1.toUpperCase();
    lowerCase = word1.toLowerCase();
    firstChar = 0;
    lastChar = numChar-1;
    secondChar = 1;
   
   
    System.out.println(word1);
    System.out.println(“The number of characters is ” + numChar);
    System.out.println(“Uppercase String: ” + upperCase);
    System.out.println(“Lowercase String: ” + lowerCase);
    System.out.println(“The first character is ” + word1.charAt(firstChar));
    System.out.println(“The second character is ” + word1.charAt(secondChar));
    System.out.println(“The last character is ” + word1.charAt(lastChar));
    System.out.println(word1.charAt(lastChar) + word1.substring(secondChar,lastChar) + word1.charAt(firstChar));
   
  }
}

//end uber 1337 haxxor Java program
  /*String Output
  Welcome to DrJava.
> java Stringprogram

computer
The number of characters is 8
Uppercase String: COMPUTER
Lowercase String: computer
The first character is c
The second character is o
The last character is r
romputec
> */

OMG WTF READ POST BELOW

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s