Randomises capitalisation of letters like bird spongebob A friend and I have an inside joke; well, not exactly inside if it is based off an existing meme. We would send messages in the 'retarded' form, as the meme 'Retarded Spongebob' does in the example "i WoUlD aPPreCiaTE sOmE fEeDbAcK oN mY CoDE". It takes in an input, loops through the character array formed from the string input, randomises the capitalisation, and the entire array is put back for output. Any improvements that can be suggested?

import java.util.Scanner;
import java.util.concurrent.ThreadLocalRandom;

public class RetardedSpongebobifier {
    private char prevChar = 'z';

    public static void main(String[] args) {

        // Take input of sentence
        Scanner scanner = new Scanner(System.in);
        System.out.println("Please enter desired sentence to RS.");
        // Save input
        String input = scanner.nextLine();
        // Turn input into a character array
        char[] inputArray = input.toCharArray();

        RetardedSpongebobifier obj = new RetardedSpongebobifier();
        // Create array to hold new array
        char[] charArray = new char[input.length()];

        // Run through the list of characters, maybe changing them to uppercase or lowercase
        for (int i = 0; i &lt; input.length(); i++) {
            // Send character for random capitalizing
            char adding = obj.randCap(inputArray[i]);
            // Add uppercase/lowercase character back into the character array
            charArray[i] = adding;
        }

        // Print array
        System.out.print(new String(charArray));
    }

    private char randCap(char character) {

        // Check if character is not any of the blacklisted
        if (character == 'i' || character == 'l' || character == ' ' || character == ',' || character == '.') {
            prevChar = character;
            return character;
        }
        else {
            // Random TRUE/FALSE
            boolean isCap = (Math.random() * 100) &gt;= 50;
            if (isCap &amp;&amp; Character.isLowerCase(prevChar)) {
                prevChar = character;
                // Return uppercase letter
                return Character.toUpperCase(character);
            }
            else {
                prevChar = character;
                // Return lowercase letter
                return Character.toLowerCase(character);
            }
        }
    }
}
Unnecessary comments

You have a lot of comments telling WHAT the code does. Comments should tell -why- you do it in a certain way or what else you have tried but failed. Just repeating in comment what the code says is a waste of time (for the reader and the writer as well)

Method name

You method is called randCap. I prefer just naming it what it does, so randomCapitalize() for example. Makes the code more readable. 

Logic

I tried to understand what the logic behind the prevCharacter is. It is not immediately clear how it works, and what is has to do with the blacklist.

I think you mean to make sure there are not many lowercase or uppercase characters in a row?

You don't need such a long blacklist, because you can safely call toUpperCase() and toLowerCase() on comma's etc.

Code in main loop

You can move a lot of the code out of the main loop, by adding a method public String spongeBobify(String s) to the class. The main method will only take care of the input/ouput. 

Unnecessary calculations

What is wrong with:

boolean isCap = Math.random() &gt;= 0.5;


or, if you have a Random object, random.nextBoolean()?

Closing the scanner

You need to close your Scanner, you can do this by using a try-with-resources:

try (Scanner scanner = new Scanner(System.in)) {
    ...