三角型问题 [英] Triangle type issue

查看:68
本文介绍了三角型问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能指出我如何获得三角形类型的正确方向。下面是一个三角形类,由另一个完全独立的类测试。测试类的主要方法执行下面看到的代码。我想弄清楚的是我在打印三角形类型时遇到了什么问题。用户输入的整数打印正常,但我不断得到null。对于三角形类型,因为我不知道如何正确地调用该方法的这一部分。我在实例变量中将triangleType作为String,这是正确的吗?我也将triangleType作为实例方法的一部分,是正确的还是应该分开?任何帮助将不胜感激。

Can someone point me in the right direction on how to get the triangle type to display. Below is a triangle class that is tested by another completely separate class. The main method of the test class executes the code you see below. What I''m trying to figure out is what I''m doing wrong in getting the triangle type to print. the integers typed in by the user print fine, but I keep getting "null" for the triangle type because I don''t know how to call that part of the method correctly. I have triangleType as a String in the instance variables, is that correct? I also made triangleType part of the instance method, is that correct or should it be separate? Any help would be appreciated.

展开 | 选择 | Wrap | 行号

推荐答案

您确定类型的逻辑是故障。重新考虑一下,特别是考虑Side1 == Side3,而不是Side2。
Your logic for determining the type is faulty. Rethink it, especially considering if Side1 == Side3, but not Side2.


这是怎么回事?

How''s this?

展开 | 选择 | Wrap | 行号


展开 | 选择 | Wrap | 行号


这篇关于三角型问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆