Click here to Skip to main content
15,890,741 members
Home / Discussions / Java
   

Java

 
GeneralRe: Read PDF tables using iText Pin
raesark23-Apr-14 1:28
raesark23-Apr-14 1:28 
GeneralRe: Read PDF tables using iText Pin
TorstenH.23-Apr-14 1:59
TorstenH.23-Apr-14 1:59 
GeneralRe: Read PDF tables using iText Pin
raesark23-Apr-14 3:19
raesark23-Apr-14 3:19 
GeneralRe: Read PDF tables using iText Pin
TorstenH.23-Apr-14 4:03
TorstenH.23-Apr-14 4:03 
QuestionApplet Automation Pin
Member 909935222-Apr-14 20:06
professionalMember 909935222-Apr-14 20:06 
AnswerRe: Applet Automation Pin
TorstenH.23-Apr-14 1:11
TorstenH.23-Apr-14 1:11 
GeneralRe: Applet Automation Pin
Member 909935223-Apr-14 1:41
professionalMember 909935223-Apr-14 1:41 
QuestionConstructor problem Pin
john_meee21-Apr-14 23:16
john_meee21-Apr-14 23:16 
I have a problem with constructors ... I never understood how they work.
At Caine c=new Caine();
Animal c1=new Caine();
Pisica p=new Pisica();
Error: Constructor Caine in Caine class cannot be applied to given class

Java
package test2;
public class Test2 {

     public static void main(String[] args) {
         ListaAnimale lista= new ListaAnimale();
         Caine c=new Caine();   
         Animal c1=new Caine();        
         Pisica p=new Pisica();
         lista.adauga(c);
         lista.adauga(p);
         c.faceZgomot();
     }
}
class ListaAnimale{
    private Animal [] animale = new Animal[5];
    private int index=0;
    public void adauga(Animal a){
        if(index <animale.length)
        {
            animale[index]=a;
            System.out.println("Un nou animal pe pozitia " +index);
            index++;
        }
    }
}

abstract class Animal{
 private String nume;
 private int  varsta;
 public Animal(String n, int a){
        this.nume=n;
        this.varsta=a;
    }    
 
 public void faceZgomot(){System.out.println("ce zgomot face");}
 public abstract void mananca();
 public void doarme(){
     System.out.println("Doaermee");
 }

  
}
class Caine extends Animal{
   
    public Caine(String n, int a){
    super(n,a);
    }  
    public  void faceZgomot(){System.out.println("wooar");}
    public  void mananca(){System.out.println("caarne");}
 }
class Pisica extends Animal{
    
    public Pisica(String n, int a){
    super(n,a);
    }  
    public  void faceZgomot(){System.out.println("miau");}
    public  void mananca(){System.out.println("lapte");}
}

AnswerRe: Constructor problem Pin
TorstenH.23-Apr-14 1:22
TorstenH.23-Apr-14 1:22 
AnswerRe: Constructor problem Pin
vipul57412-Jun-14 21:46
vipul57412-Jun-14 21:46 
QuestionIs there a pre-defined mthod in java works same as GetFontData pre-defined function in C++ Pin
f2620-Apr-14 20:44
f2620-Apr-14 20:44 
AnswerRe: Is there a pre-defined mthod in java works same as GetFontData pre-defined function in C++ Pin
TorstenH.23-Apr-14 1:25
TorstenH.23-Apr-14 1:25 
GeneralRe: Is there a pre-defined mthod in java works same as GetFontData pre-defined function in C++ Pin
f2630-Apr-14 22:58
f2630-Apr-14 22:58 
Questionhow to create exe file Pin
mrraviprakash18-Apr-14 0:30
mrraviprakash18-Apr-14 0:30 
SuggestionRe: how to create exe file Pin
Richard MacCutchan18-Apr-14 3:45
mveRichard MacCutchan18-Apr-14 3:45 
Questionj2me bluetooth application Pin
usic vicky15-Apr-14 19:46
usic vicky15-Apr-14 19:46 
AnswerRe: j2me bluetooth application Pin
Richard MacCutchan15-Apr-14 22:21
mveRichard MacCutchan15-Apr-14 22:21 
Questionroom allocation and optimisation Pin
Member 1032564514-Apr-14 7:47
Member 1032564514-Apr-14 7:47 
SuggestionRe: room allocation and optimisation Pin
Richard Deeming14-Apr-14 9:00
mveRichard Deeming14-Apr-14 9:00 
AnswerRe: room allocation and optimisation Pin
Bernhard Hiller14-Apr-14 22:52
Bernhard Hiller14-Apr-14 22:52 
Questionchat application Pin
nik-123414-Apr-14 7:15
nik-123414-Apr-14 7:15 
AnswerRe: chat application Pin
Richard MacCutchan14-Apr-14 21:52
mveRichard MacCutchan14-Apr-14 21:52 
AnswerRe: chat application Pin
mkumar_mtech15-Apr-14 1:57
professionalmkumar_mtech15-Apr-14 1:57 
Questionhow to apply horizental scroll bar in jsf Pin
sunil khichar11-Apr-14 7:26
sunil khichar11-Apr-14 7:26 
AnswerRe: how to apply horizental scroll bar in jsf Pin
Richard MacCutchan11-Apr-14 7:45
mveRichard MacCutchan11-Apr-14 7:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.