TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Deepanshu Joshi
NA
2
462
how to correct the error
Feb 5 2021 7:11 AM
using
System;
namespace
classanotherclass {
class
Program {
public
class
class1 {
public
int
price {
get
;
set
;
}
public
string
productname {
get
;
set
;
}
public
class1(
int
price,
string
productname) {
this
.price = price;
this
.productname = productname;
}
public
int
price1() {
return
price;
}
}
public
class
class2: class1 {
public
class1 c;
public
int
quantity = 80;
public
class2():
base
(10,
"rice"
) {}
public
int
price2(class1 c) {
return
c.price * quantity;
}
}
static
void
Main(
string
[] args) {
var C =
new
class2();
var p = C.price2();
Console.WriteLine(
"total for rice"
+ p);
}
}
}
Reply
Answers (
2
)
QR Code Generator
asp.net core show sublist if data exists