Analyze the below program, and fill the correct code so that it produces the below output: 0.0 101 public class book { private int bookid; private double bookprice; public int getbookid() { return bookid; } public void setbookid(int bookid) { this.Bookid = bookid; } public double getbookprice() { return bookprice; } public void setbookprice(double bookprice) { this.Bookprice = bookprice; } } class test { public static void main(string a[]) { book bobj=new book(); blank blank blank } }
Answers
Answered by
3
Answer:
Explanation:
The correct answer is:
Analyze the below program and choose the appropriate code so that it produces the below output:
0
101
class Book {
private int bookId;
private double bookPrice;
public int getBookId() {
return bookId;
}
public void setBookId(int bookId) {
this.bookId = bookId;
}
public double getBookPrice() {
return bookPrice;
}
public void setBookPrice(double bookPrice) {
this.bookPrice = bookPrice;
}
}
public class Test {
public static void main(String a[]) {
Book bobj=new Book();
[System.out.println(bobj.getBookId());]
[bobj.setBookId(101);]
[System.out.println(bobj.getBookId());]
}
}
answer is:
[System.out.println(bobj.getBookId());]
[bobj.setBookId(101);]
[System.out.println(bobj.getBookId());]
Similar questions
Computer Science,
5 months ago
Chemistry,
5 months ago
Math,
5 months ago
Biology,
11 months ago
Biology,
11 months ago
Computer Science,
1 year ago
English,
1 year ago