Very simple java program not working

  • Context: Java 
  • Thread starter Thread starter camel-man
  • Start date Start date
  • Tags Tags
    Java Program
Click For Summary

Discussion Overview

The discussion revolves around a Java programming issue encountered by a user while trying to print output to the screen. The scope includes programming concepts, error handling, and the transition from C programming to Java, particularly in the context of integrating SQL with Java.

Discussion Character

  • Technical explanation, Homework-related

Main Points Raised

  • The original poster reports an error related to the use of "system.out.println" in their Java code, indicating a lack of familiarity with Java syntax.
  • One participant suggests correcting the case to "System.out.println(...)" to resolve the error.
  • Another participant explains that Java is case-sensitive and highlights the convention of using upper-case letters for class names and lower-case letters for variable and method names.
  • The original poster expresses relief at the simplicity of the solution and anticipates further questions due to their limited experience with Java.

Areas of Agreement / Disagreement

Participants generally agree on the importance of case sensitivity in Java and the specific correction needed for the error. The discussion remains focused on the original poster's challenges without broader disagreements.

Contextual Notes

The original poster's background in C programming may influence their understanding of Java, and their mention of SQL integration suggests additional complexity in their project that is not fully addressed in this exchange.

Who May Find This Useful

Individuals transitioning from C to Java, beginners in Java programming, or those encountering similar syntax errors in their code.

camel-man
Messages
76
Reaction score
0
I am using the netbeans IDE

All I am trying to do is print out to the screen, but I keep getting this error.

Code:
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: system.out.println
	at mysqlconn.mainhgf4.main(mainhgf4.java:19)

Here is my short code

Code:
package mysqlconn;
import java.io.BufferedReader;
/**
 *
 */
public class mainhgf4{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        
       system.out.println("Welcome friend!");
    }
}

This is not really a java program, it is a SQL program that I am supposed to somehow implement a DB in java... IDK I am so frustrated over this. I am originally a C programmer and have very basic knowledge of java, but the fact that I have to incorporate a database and SQL queries is making this impossible for "ME", I know a lot of people can do this with their eyes closed.
 
Technology news on Phys.org
Try System.out.println(...)
 
Java is a case-sensitive language, and by convention, class names (like System), start with an upper-case letter, whereas variable and method names start with a lower-case letter (like out & println() )
 
Ahh wow that was simple lol thank you, I might be back for more questions because if I had trouble with that then there is no telling how many problems I am going to run across lol
 

Similar threads

Replies
8
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 14 ·
Replies
14
Views
6K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
13K
  • · Replies 5 ·
Replies
5
Views
2K