May I ask, how to use getter() and setter() in java? Please give a simple example, thank you!

Excuse me, how to use getter() and setter() in java? Please give a simple example, thank you! The get set method is mainly used to control access rights. Generally, the attributes in the class are set to private and cannot be directly accessed from outside the class. 1. When it needs to be read, it is obtained through the get method. 2. When it needs to be modified. It is safer to set the program through the set method. For example, class Cat{ private String color; public Cat(String color){ this.color = color; }public String getColor(){ return this.color; }} In this example, it is a cat class, and its color is the same as It is something you are born with and generally cannot be changed. So set its color in the constructor. After a Cat object is created, you can only get its color, but not set it. How to use the setter method to set the array after java encapsulates it with privata Your error is x<this.emps[].length in the for statement This.emps[] refers to a member variable, but the member variable emps has not been assigned a value and is still a null reference. How can you .length? Remove…

May I ask, what is your process for updating the site (including the database)? -php tutorial

The project and database need to be updated recently, if the changes are relatively large. So how to do it? For example Do you need to stop the service before updating? What should we pay attention to when updating? How often is the best time to update? How to update the database? Because the local test data is different from the server data. Direct coverage is not possible. …. I don’t have much practical experience, so I am more theoretical. As we all know, the database of a website is the soul of the website and the wealth of the enterprise. As long as there is a problem with one piece of data, there may be very troublesome consequences. I hope people with experience can share it! ! ! It would be great if you can talk about some experience in database backup, restoration, database operation log generation, etc.! Thank you in advance. Reply to discussion (solution) This is a very general question. If you really want to know the structure of the website, The database structure has also changed, so just back up the old site, import the data into the new database, and then deploy and publish the…

May I ask, which video tutorial is better for learning PHP? -php tutorial

I am a PHP beginner. I want to watch video tutorials to learn PHP without going to the training department, but I searched online and couldn’t compare: PHP100, Beifeng.com Li Yanhui and 54 programmer videos. Although the PHP100 video is free, The quality is really bad. Li Yanhui’s videos are rather old-fashioned and many similar composers have not covered it. I have already learned the basic grammar. However, 54 Programmer’s videos are too expensive. It’s hard to make a decision now. Can anyone recommend them? Any other php videos? Don’t ask me to read the documentation. It’s too tiring to read the documentation. I’m quite busy and I’m in business. I’m purely interested in learning programming as an amateur. Please help and recommend me Response content: I am a PHP beginner. I want to watch video tutorials to learn PHP and don’t want to go to the training department, but I searched online and couldn’t compare: PHP100, Beifeng.com Li Yanhui also has 54 programmer videos, among which PHP100 videos are It’s free, but the quality is really poor. Li Yanhui’s videos are rather old-fashioned and many similar composers haven’t covered it. I’ve already learned the basic grammar, and 54 Programmer’s…

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索