Results 1 to 2 of 2
- 07-16-2007, 06:31 PM #1
Member
- Join Date
- Jul 2007
- Posts
- 26
- Rep Power
- 0
Error: Non-static method append(char) cannot be referenced from a static context
I'm having trouble trying to use StringBuffer() on the following code. The error I'm getting is:
ChangeBase.java:91: non-static method append(char) cannot be referenced from a static context.
Java Code:public void actionPerformed(ActionEvent e) { //.... for(int j = 0; j<count; j++){ test = ChangeBase.pop(); System.out.println(test); StringBuffer.append(str.charAt(test));//where str is just a string. This is line 91. } } StringBuffer buf = new StringBuffer(); jtfResult.setText(buf.toString()); //...
- 08-07-2007, 06:05 AM #2
Member
- Join Date
- Jul 2007
- Posts
- 39
- Rep Power
- 0
Similar Threads
-
non-static member can not be referenced from a static context
By christina in forum New To JavaReplies: 3Last Post: 03-20-2009, 01:35 AM -
Explicit static initialization with the static clause
By Java Tip in forum java.langReplies: 0Last Post: 04-17-2008, 12:07 AM -
Help with code (static error)
By oceansdepth in forum New To JavaReplies: 1Last Post: 03-28-2008, 05:32 AM -
is overriding static method possible
By raghu in forum Advanced JavaReplies: 1Last Post: 01-22-2008, 01:38 AM -
Error: non-static variable height cannot be referenced from a static context at line
By fernando in forum AWT / SwingReplies: 1Last Post: 08-01-2007, 10:25 PM
Bookmarks