Your problem is not with vector, it is with scanner methods; you can read this answer, it will give you a good idea about how to use scanner methods.
That's because the Scanner.nextInt method does not read the newline character in your input created by hitting "Enter," and so the call to Scanner.nextLine returns after reading that newline.
You will encounter the similar behaviour when you use Scanner.nextLine after Scanner.next() or any Scanner.nextFoo method (except nextLine itself).
Your code working:
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
System.out.println("enter the choice:");
System.out.println("\n1.Accept first name and surname\n2.display total name\n3.Exit.");
int choice=Integer.parseInt(sc.nextLine());
Vector v1=new Vector ();
Vector<Name> v2=new Vector<Name>();
while(choice !=3)
{
if(choice==1)
{
System.out.println("enter number of persons :");
int n=Integer.parseInt(sc.nextLine());
for(int i=1;i<=n;i++)
{
System.out.println("enter the first name of person number :"+(i));
String fn =sc.nextLine();
System.out.println("enter the last name of person number :"+(i));
String ln =sc.nextLine();
v1.add( new Name( fn, ln));
}
}
System.out.println("\n\n Enter the choice:");
System.out.println("\n1.Accept first name and surname\n \n2.display total name\n3.Exit.");
choice=Integer.parseInt(sc.nextLine());
if(choice==2)
{
System.out.println("\n ********************** Here is total:"+v1.size()+"\n\n");
}
}
System.out.println("thank you");
}
}