class

java反射(基础了解)

荒凉一梦 提交于 2019-12-31 08:04:24
package cn.itcast_01; /** *Person类 */ public class Person { /** 姓名 */ private String name; /** 年龄 */ private int age; /** 性别 */ private String sex; public Person(String name, int age, String sex) { super(); this.name = name; this.age = age; this.sex = sex; } public Person() { super(); // TODO Auto-generated constructor stub } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() { return age; } public void setAge(int age) { this.age = age; } public String getSex() { return sex; } public void setSex(String sex) { this.sex = sex; }

Class operators

为君一笑 提交于 2019-12-31 07:45:53
问题 I'm having a problem to make the code: void main(){ Matrix c(rows,cols);//rows & cols are int numbers c[0][0]=2//the line that I'm having a problem to do the operator } //My class defined like this: class Matrix{ public: Matrix(int rows,int cols): rows(rows), cols(cols){ mat= new double*[cols]; for( int i=0; i<rows;i++){ *mat=new double[i]; } } private: int rows,cols; double **mat; }; How can I make an operator that will help me to do the line that I'm having a problem with? 回答1: There are no

How to change a label from another class? c# windows forms visual studio

妖精的绣舞 提交于 2019-12-31 07:16:25
问题 I know there are a lot of threads talking about this and believe me I've seen all of them, but I think I'm a little slow and cant figure out how to do this so here is the thing! I have one form public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button4_Click(object sender, EventArgs e) { adi mYadi= new adi(); adi.paso(); } private void Form1_Load(object sender, EventArgs e) { } public void l8u(string l ) { label8.Text = l; } } The l8u method is supposed

How to change a label from another class? c# windows forms visual studio

*爱你&永不变心* 提交于 2019-12-31 07:16:25
问题 I know there are a lot of threads talking about this and believe me I've seen all of them, but I think I'm a little slow and cant figure out how to do this so here is the thing! I have one form public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button4_Click(object sender, EventArgs e) { adi mYadi= new adi(); adi.paso(); } private void Form1_Load(object sender, EventArgs e) { } public void l8u(string l ) { label8.Text = l; } } The l8u method is supposed

creating a playing card Class Python

荒凉一梦 提交于 2019-12-31 07:07:12
问题 I created a playing card object that has certain attributes of rank, suite and blackjack value. The blackjack value part keep getting a TypeError that says I can't compare between instances of list and int . I'm not sure how to resolve (how to/if I can compare just the index of the list and then give it the blackjack value based on its index)? Does the if/elif block belong within the bjValue() function or in the init () function? Here's my code: class Card: """playing card object where

Java class with no constructor?

强颜欢笑 提交于 2019-12-31 06:37:45
问题 I have this class class Customer{ int ID; Time arriveTime; Time serviceTime; Time completeTime; int transaction; } Don't I need a constructor in order to set the values inside? I will be using this class to hold different values while making an array of Customers. Wouldn't this mean I would need this in order to set the values? public Customer(int id, Time arrive, Time service, Time complete, int trans){ ID = id; arriveTime = arrive; serviceTime = service; completeTime = complete; transaction

Java class with no constructor?

本秂侑毒 提交于 2019-12-31 06:36:28
问题 I have this class class Customer{ int ID; Time arriveTime; Time serviceTime; Time completeTime; int transaction; } Don't I need a constructor in order to set the values inside? I will be using this class to hold different values while making an array of Customers. Wouldn't this mean I would need this in order to set the values? public Customer(int id, Time arrive, Time service, Time complete, int trans){ ID = id; arriveTime = arrive; serviceTime = service; completeTime = complete; transaction

Swift class de-initialized at end of scope instead of after last usage

纵饮孤独 提交于 2019-12-31 06:22:43
问题 I've asked this question asking about the guarantees of the lifetime of a reference in a local variable and was referred to this thread in which the exact semantics of the lifetime of references to class instances were discussed. AFAICT from that thread, a class instance may be de-initialized right after the last usage of a variable containing the last reference, even before other expressions in the same statement are evaluated. It is argued there that allowing this behavior is necessary to

Add multiple choice to Dialog and make it functioning

蹲街弑〆低调 提交于 2019-12-31 06:08:14
问题 What I want is to add a question with 3-4 options to the JDialog import java.awt.*; import java.awt.event.*; import javax.swing.*; public class VocabHelper { private JFrame mainFrame; private JPanel mainPanel; private JPanel animalPanel; public JDialog animalDialog; private JLabel titleLbl; private JLabel subtitle; //Call main GUI public VocabHelper() { mainGUI(); } //Main Method public static void main(String[] args) { VocabHelper vocabHelper = new VocabHelper(); vocabHelper.showActionEvents

Add multiple choice to Dialog and make it functioning

一曲冷凌霜 提交于 2019-12-31 06:08:11
问题 What I want is to add a question with 3-4 options to the JDialog import java.awt.*; import java.awt.event.*; import javax.swing.*; public class VocabHelper { private JFrame mainFrame; private JPanel mainPanel; private JPanel animalPanel; public JDialog animalDialog; private JLabel titleLbl; private JLabel subtitle; //Call main GUI public VocabHelper() { mainGUI(); } //Main Method public static void main(String[] args) { VocabHelper vocabHelper = new VocabHelper(); vocabHelper.showActionEvents