Click here to Skip to main content
15,887,812 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
When I run this on as a Java application it comes up with the warning "Selection does not contain a main type". Can someone tell me what's wrong? And does it look like it would run after the error no longer appears?

package com.ajaxwoot;

public class Camcorder {

	int recTime;
	boolean canRecord = true;

	public void record(){
		if (canRecord = true){
			System.out.println("I'm recording this now.");
		}
		recTime = 1;
		while (recTime < 20){
			System.out.println("In the process of recording. Time left: " + recTime++);
			
		}
	}
}
Posted

1 solution

This is the complete code right?

Then you're missing the main method, which is needed as the entry point to your coding:

Java
public class Camcorder{
  public static void main(String[] args) {
    Camcorder oComcorder = new Camcorder();
    Camcorder.record();
  }

// rest of your code goes here


you should also read here to understand what it is about:
Setting an Application's Entry Point[^] @ Java Tutorials
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900