Identifier Expected Error (Java Tutorial)

preview_player
Показать описание
Learn about the Java error: identifier expected and how to fix it.

#Java #IdentifierExpected #ErrorIdentifierExpected
Рекомендации по теме
Комментарии
Автор

I kept geting the error with the code below:

public class new {

public static void main (String[] args) {


System.out.println("Hello, User!");

}
}

VOgamingofficial
Автор

please sort this error sir
public class LlQ4 {
public class node{
int data;
node next;
node(int data ){
this.data=data;
}
}

public static node intersection(node head1, node head2){
int Length(){/// ERROR
node temp=head;
int len=0;
while(temp!=null){
len++;
temp=temp.next;
}
return len;
}

node temp1=head1;
node temp2=head2;
int l1=length(head1);
int l2=length(head2);
for(int i=0; i<=(l1-l2); i++){
temp1=temp1.next;
}
while(temp1!=null){
temp1=temp1.next;
temp2=temp2.next;
if(temp1.data==temp2.data){
return temp1;
}
}
}
public static void main(String arg[]){
node a= new node(87);
node b= new node(100);
node c= new node(13);
node d= new node(4);
node e= new node(5);
node f= new node(12);
node g= new node(10);
node h= new node(90);
node i= new node(9);
a.next=b;
b.next=c;
c.next=d;
d.next=e;
e.next=f;
f.next=g;
h.next=i;
i.next=e;
intersection(a, h);
}
}

muskantiwari