Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   JAVA (https://www.clubdelphi.com/foros/forumdisplay.php?f=16)
-   -   selection doest not contain a main type (https://www.clubdelphi.com/foros/showthread.php?t=64243)

chouki 24-03-2009 13:43:00

selection doest not contain a main type
 
hola
acabo de importar un proyecto en eclipse
para ejecutarlo pero kdo selecciono el fichero ,con botón derecho de ratón para ejecutarlo como
java application me sale dicho mensaje mientras que el fichero contiene la clase del main
gracias

__hector 26-03-2009 20:57:01

pon el codigo a ver.

chouki 27-03-2009 07:53:12

hola hector
gracias por su respuesta :
Código:

//este método lo único que hace es insertar por inserción
publicstaticvoid insertar(int v[],int tam)
{
int aux,j;
for(int i=1;i<tam;i++)
{
  aux=v[i];
  for( j=i-1;j>=0;j--)
{
    if(aux>v[j])
  {
    v[j+1]=aux;
      break;
  }
  else
    v[j+1]=v[j];
}
  if(j==-1)
  v[0]=aux; 
}
}
public static <T extends Comparable<? super T>> void ordIns(T v[], int n)
{
  if (ta-1>0)
{
  ordIns(vector,ta-1);
  insertar(vector,ta);
}
}

// Convierte un vector a una cadena de caracteres
public static <T> String vectorAString(T v[]) {
String res = "[";
for(int i=0; i<v.length; i++)
res += v[i].toString()+(i==v.length-1 ? ']' : ',');
return res;
}

public static void main (String args[])

{

Integer vEnt[] = {3,7,6,4,8,8};
ordIns(vEnt, vEnt.length);
System.out.println(vectorAString(vEnt));

Character vCar[] = {'d','c','v','b'};
ordIns(vCar, vCar.length);
System.out.println(vectorAString(vCar));
}




La franja horaria es GMT +2. Ahora son las 01:04:54.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi