Results 1 to 2 of 2
  1. #1
    soad03 is offline Member
    Join Date
    Aug 2014
    Posts
    1
    Rep Power
    0

    Default cant find the error

    hello guys, please help me!!!!!!!!!!!! y cant find the error in this code!(im argentinian and my english is bad...sorry)

    LibCal.java:6: illegal start of expression
    public establecerNombre (String nombre)
    ^
    LibCal.java:6: ')' expected
    public establecerNombre (String nombre)
    ^
    LibCal.java:6: illegal start of expression
    public establecerNombre (String nombre)
    ^
    LibCal.java:6: ';' expected
    public establecerNombre (String nombre)
    ^
    LibCal.java:22: class, interface, or enum expected
    }
    ^
    5 errors
    ---------------------------------------------------------------------------------------------------------------------
    this is the code

    public class LibCal//clase
    {
    private String nombreDelCurso ();//crear una variable de instancia
    {
    //---------------------------metodo1---------------------------------------------------------
    public establecerNombre (String nombre)
    {
    nombreDelCurso = nombre;
    }
    //---------------------------metodo2--------------------------------------------------------
    public string obtenerNombreDelCurso()
    {
    return NombreDelCurso;
    }
    //---------------------------metodo3---------------------------------------------------------
    public void mostrarMsj()
    {
    System.out.printf("el nombre del curso es \n%s\n", obtenerNombreDelCurso);
    }
    //---------------------------------------------------------------------------------------
    }
    }





    import java.util.Scanner;
    public class PruebaLibCal
    {
    public static void main (String [] args )
    {
    LibCal miLibCal = new Libcal();

    Scanner entrada = new Scanner (System.in);

    miLibCal.mostrarMsj();

    System.ouy.printf("ingrese nuevo nombre de curso\n");

    String nombre1 = entrada.NextLine();

    miLibCal.establecerNombre(nombre);

    miLibCal.MostrarMsj();

    }
    }
    Last edited by soad03; 08-01-2014 at 01:54 PM.

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default Re: cant find the error

    Repost your code using code tags to retain formatting.
    Do not use large annoying fonts and colours. This will reduce your chances of getting help.

Similar Threads

  1. Replies: 2
    Last Post: 06-17-2013, 10:26 AM
  2. jarsiner Error (Error: could not find libjava.so)
    By haythame78 in forum Java Applets
    Replies: 2
    Last Post: 08-22-2011, 10:44 AM
  3. can any one plz find the error.
    By shalini_cmc in forum AWT / Swing
    Replies: 1
    Last Post: 03-23-2011, 09:34 AM
  4. Find the error in this and why this can't be ?
    By ron2794 in forum New To Java
    Replies: 11
    Last Post: 12-14-2010, 03:23 PM
  5. I need help with an error! Cannot find symbol error!
    By ambria1975 in forum New To Java
    Replies: 2
    Last Post: 07-07-2010, 01:37 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •