java矩阵面积_Java基础 矩阵面积
发布日期:2021-06-24 16:13:16 浏览次数:2 分类:技术文章

本文共 602 字,大约阅读时间需要 2 分钟。

提供 数据结构与算法题目 的平台是LintCode,参考链接是:http://www.lintcode.com/zh-cn/

问题描述:

20180111000502435765.png

参考代码:

public class Rectangle {

/*

* Define two public attributes width and height of type int.

*/

// write your code here

public int width;

public int height;

/*

* Define a constructor which expects two parameters width and height here.

*/

// write your code here

Rectangle(int width , int height){

this.width = width;

this.height = height;

}

/*

* Define a public method `getArea` which can calculate the area of the

* rectangle and return.

*/

// write your code here

public int getArea(){

return this.width * this.height;

}

}

结果与评价:

20180111000502450414.png

转载地址:https://blog.csdn.net/weixin_33744799/article/details/114216641 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:java 字母冒泡排序_java实现冒泡排序
下一篇:java 模拟火车站售票系统_train 火车票售票系统 用java模拟实现了火车站对火车票的售票工作 - 下载 - 搜珍网...

发表评论

最新留言

做的很好,不错不错
[***.243.131.199]2024年03月31日 15时04分57秒