简体   繁体   English

无法解析类型java.lang.Charsequence。 它是从required.class文件间接引用的

[英]The type java.lang.Charsequence cannot be resolved. It is indirectly referenced from required.class files

I know this question was asked on here but it was related to something different. 我知道这个问题,有人问在这里,但它涉及到不同的东西。 This is my program, I had to create my own class. 这是我的程序,我必须创建自己的类。 Also, when I try to use the system.out.printf () function, it doesnt work how come? 另外,当我尝试使用system.out.printf()函数时,它为什么不起作用? Thank you, from a very lost beginner programmer. 谢谢您,我是一个非常失落的初学者程序员。 :

public class IDInfo {
public static void main(String[] args){
}




private double name;
private double studentID;
private double Major;
private double CreditsNeeded;
private double CreditsTaken;

String getName = "Alex Wilson";
String getID = "916183391";
String getMajor1 = "Biochemistry";
String getCreditsNeeded = "128";
String getCreditsTaken = "14";


public void setname ( double name  )
{
    name = name; 
}

public void setstudentID (double ID)
{
    studentID = ID;

}

public void setMajor (double Major)
{
    Major=Major;

}

public void setCreditsNeeded (double CreditsNeeded)
{
    CreditsNeeded=CreditsNeeded;

}

public void setCreditsTaken (double CreditsTaken)
{
    CreditsTaken=CreditsTaken;

}

public double getName()
{
    return name;

}

public double getID ()
{
    return studentID;

}

public double getMajor ()
{
    return Major;

}

public double getCreditsNeeded ()
{
    return CreditsNeeded;
}

public double getCreditsTaken ()
{
    return CreditsTaken;

}

public double getCreditsRemaining ()
{
    return CreditsNeeded - CreditsTaken;
}
{



}}

Java is a case sensitive language, so make sure your references are correct. Java是区分大小写的语言,因此请确保您的引用正确。 I would also suggest reading about the naming conventions , as what you have shown is very inconsistent. 我还建议您阅读有关命名约定的内容 ,因为您所显示的内容非常不一致。

The issue seems with the compiler. 该问题似乎与编译器有关。 If you are using jdk 8, I would suggest rolling back compiler to jdk 7 and rebuild the code. 如果您使用的是jdk 8,我建议将编译器回滚到jdk 7并重建代码。

Some more places to consider - 还有更多地方值得考虑-

If you are using any of the following release of eclipse 如果您使用以下任何版本的eclipse

Helios doesn't support Java 8 at all. Helios完全不支持Java 8。 Kepler doesn't support it by default. 开普勒默认情况下不支持它。 But eclipse have released patch for the same. 但是Eclipse已经发布了相同的补丁。

Kepler Update Site 开普勒更新网站

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法解析java.lang.CharSequence类型。 它是从所需的.class文件间接引用的 - The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files 无法解析类型java.lang.Charsequence。 从所需的.class文件间接引用 - The type java.lang.Charsequence cannot be resolved. It is indirectly referenced from required .class file 第7行的“ yyy.jspf”错误:无法解析类型java.lang.CharSequence。 从所需的.class文件间接引用它 - Error in “yyy.jspf” at line 7: The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files 无法解析类型 java.lang.Object。 它是从 required.class 文件中间接引用的 - The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Eclipse 中的 Java 项目:无法解析 java.lang.Object 类型。 它是从所需的 .class 文件中间接引用的 - Java project in Eclipse: The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Eclipse中的错误(适用于Android):无法解析java.lang.String类型。它是从所需的.class文件间接引用的 - Error in Eclipse (for Android): The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files Eclipse jdk 11问题:java.lang.String类型无法解析。 它是从 required.class 文件中间接引用的 - Eclipse jdk 11 problem: The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files 无法解析java.io.ObjectInputStream类型。它是从所需的.class文件间接引用的 - The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files 无法解析java.rmi.RemoteException类型。 它是从java中所需的.class文件错误中间接引用的 - The type java.rmi.RemoteException cannot be resolved. It is indirectly referenced from required .class files error in java Android:无法解析java.awt.Image类型。 它是从所需的.class文件间接引用的 - Android: The type java.awt.Image cannot be resolved. It is indirectly referenced from required .class files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM