Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - illegal start of expression
at barchart.BarChart.main(BarChart.java :18)
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package barchart;
import java.util.Scanner;
/**
*
* @author X
*/
public class BarChart {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
private int numberOfStars;
public BarChart(int numberOfStars) {
this.numberOfStars = numberOfStars;
}
public void displayBar() {
for(int i=0;i<=5;i++);
{
System.out.print("*");
System.out.println();
}
};
public class BarChartTester {
public void main(String [] args) {
Scanner input = new Scanner(System.in);
int i;
// Loop 5 times asking for a number and creating a
// BarChart object, and calling the displayBar method
for (i=0;i<=5;i++)
{System.out.print("Enter a number: ");
int numberOfStars = input.nextInt();
BarChart BarChart = new BarChart(numberOfStars);
BarChart.displayBar();
}
};
package barchart;
import java.util.Scanner;
/**
*
* @author X
*/
public class BarChart {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
private int numberOfStars;
public BarChart(int numberOfStars) {
this.numberOfStars = numberOfStars;
}
public void displayBar() {
for(int i=0;i<=5;i++);
{
System.out.print("*");
System.out.println();
}
};
public class BarChartTester {
public void main(String [] args) {
Scanner input = new Scanner(System.in);
int i;
// Loop 5 times asking for a number and creating a
// BarChart object, and calling the displayBar method
for (i=0;i<=5;i++)
{System.out.print("Enter a number: ");
int numberOfStars = input.nextInt();
BarChart BarChart = new BarChart(numberOfStars);
BarChart.displayBar();
}
};
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package barchart;
import java.util.Scanner;
/**
*
* @author X
*/
public class BarChart {
int numberOfStars;
/**
* @param args the command line arguments
*/
public BarChart(int numberOfStars) {
this.numberOfStars = numberOfStars;
}
public void displayBar() {
for(int i=0;i<=5;i++);
{
System.out.print("*");
System.out.println();
}
}
public static void main(String[] args) {
/*private*/ int numberOfStars;
}
public class BarChartTester {
public void main(String [] args) {
Scanner input = new Scanner(System.in);
int i;
// Loop 5 times asking for a number and creating a
// BarChart object, and calling the displayBar method
for (i=0;i<=5;i++)
{System.out.print("Enter a number: ");
int numberOfStars = input.nextInt();
BarChart BarChart = new BarChart(numberOfStars);
BarChart.displayBar();
}
}
}
}