Given the class Book in packages p1 and class Main in package p2. In main to create an object of Book, which of the
following are valid.
Select one:
a. p1.Book bookObj=new p1.Book();
b. Book bookObj=new Book();
c. p1.Book bookObj=new Book();
Answers
Answered by
5
Answer:
option ( B ) is right
Book bookObj=new Book ();
hope you understand
Answered by
13
Answer:
A
Explanation:
We need to give complete path to create an object in package 2 bz the class book is in different package.
Similar questions