I suspect your original problem was having code that was outside of a method body. This demo class will compile and run, and has comments pointing out what you might have been doing vs. what would be correct.
public class StringTest
{
public static final String crT = "CREATE TABLE ";
public static final String inI = "INSERT INTO ";
public static final String val = " VALUES ";
public static final String[] catInsertArray = new String[13];
// you were probably doing this, which is not allowed in Java because you are writing code outside of a method body or static initializer block
//catInsertArray[0] = inI + val + "(null, 'Student Loan', 'in', 0.00, 0.00, 0.00, 0, 0 );";
static
{
// static initialize your static member
catInsertArray[0] = inI + val + "(null, 'Student Loan', 'in', 0.00, 0.00, 0.00, 0, 0 );";
}
public static void main(String [] args)
{
// You can put code in a method
//catInsertArray[0] = inI + val + "(null, 'Student Loan', 'in', 0.00, 0.00, 0.00, 0, 0 );";
}
}
From your new comment - the code you have in your pastebin link has a few issues. One thing I have is why you are declaring a nested interface inside your DatabaseConstants class? It seems unnecessary since you're making a class for constants.
Additionally, you still leave out a static initializer block to put things into your String array. See the code below.
package com.geistware.studentbudgetapp;
import android.provider.BaseColumns;
public class DatabaseConstants {
//Variables for DDL statements and such
public static final String crT = "CREATE TABLE ";
public static final String inI = "INSERT INTO ";
public static final String val = " VALUES ";
//Table Names
public static final String CAT_BUD_TAB = "CAT_BUD_TAB";
public static final String TWO_WEE_TAB = "TWO_WEE_TAB";
//columns from the category_budget_table
public static final String CAT_ITEM = "CAT_ITEM";
public static final String IN_OUT = "IN_OUT";
public static final String BUDGET_AMOUNT = "BUDGET_AMOUNT";
public static final String ACTUAL_AMOUNT = "ACTUAL_AMOUNT";
public static final String AMOUNT_STRAYED = "AMOUNT_STRAYED";
public static final String OVERBUDGET_TF = "OVERBUDGET_TF";
public static final String AUTOSPEND_TF = "AUTOSPEND_TF";
//Initial DDL Statements and Initial INSERT statements to populate table
public static final String createCATBUDTAB = (crT + CAT_BUD_TAB +
"(_id INTEGER PRIMARY KEY, CAT_ITEM TEXT, IN_OUT TEXT, BUDGET_AMOUNT REAL, ACTUAL_AMOUNT REAL, AMOUNT_STRAYED REAL, OVERBUDGET_TF INTEGER, AUTOSPEND_TF INTEGER);");
public static final String createTWOWEETAB = (crT + TWO_WEE_TAB +
"(_id INTEGER PRIMARY KEY, SUB_CAT_ITEM TEXT, CAT_ITEM TEXT, COST REAL, ESSENTIAL_TF INTEGER, CURRENT_LAST TEXT, WEEK_ID INTEGER);");
public static String[] catInsertArray = new String[13];
// you still need to to put this code into a static initializer block
static
{
catInsertArray[0] = inI + CAT_BUD_TAB + val + "(null, 'Student Loan', 'in', 0.00, 0.00, 0.00, 0, 0 );";
}
}
However, for something like a list of constants, I'd prefer to use an enumeration, but hopefully this gets you on the right track to at least getting a working build.
catInsertArray[0]stuff outside of any method body.