netbean java找不到类,错误:找不到或加载主类(netbeans和java)

I am new to Java, but have some programming experience. I am reading a book on how to program in the Java language. My progress is impeded by my lack of knowledge with NetBeans and Java. My particular problem is that I am not seeing proper output in my output box.

Regardless of the code.

Here is an example. I am sure I am missing a minor detail:

public class Weather

{

public static void main(String[] arguments)

{

float fah = 86;

System.out.println(fah + " degrees Fahrenheit is ...");

//To conver fahrenheit to Celsius

//Begin by subtracting 32

fah = fah - 32;

//divide the answer by 9

fah = fah / 9;

//multiply that answer by 5

fah = fah * 5;

System.out.println(fah + "degree Celsius is ...");

float cel = 32;

System.out.println(cel + "degress Celsius is ...");

//To convert Farhenheit to celsius

//begin by multiplying 9

cel = cel * 9;

//divide answer by 5

cel =cel / 5;

//add 32 to the answer

cel = cel + 32;

System.out.println(cel + "degrees Farenheit");

}

}

OUTPUT BOX:

run:

Error: Could not find or load main class weather.Weather

Java Result: 1

BUILD SUCCESSFUL (total time: 0 seconds)

解决方案

Close netbeans and then delete this directory C:\Users\Your name here\AppData\Local\NetBeans\Cache

Start Netbeans again and let it read the project.

Test project. Run project. It should work fine.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值