Download What Is Encapsulation In Java? - Software Testing Tutorials graphic type that can be scaled to use with the Silhouette Cameo or Cricut. An SVG's size can be increased or decreased without a loss of quality. All of our downloads include an image, Silhouette file, and SVG file. It should be everything you need for your next project. Our SVG files can be used on adhesive vinyl, heat transfer and t-shirt vinyl, or any other cutting surface
- It Increase the usability.
- It promotes the easy maintenance in java software development.
- It makes the class easy to use for clients.
- Data access and modification control.
- It Is easy to change one part of code without affecting other part of code.
Encaps.java
package oopbasics;
public class Encaps {
private String name;
private int rollNo;
//Data setter method
public void setName(String newName) {
name = newName;
}
//Data setter method
public void setrollNo(int newrollNo) {
rollNo = newrollNo;
}
//Data getter method
public String getName() {
return name;
}
//Data getter method
public int getrollNo() {
return rollNo;
}
}
Encaps.java
package oopbasics;
public class exeEncaps {
public static void main(String[] args) {
//Created object of Encaps class to set and get data.
Encaps encaps = new Encaps();
//Set data using setter methods of Encaps class.
encaps.setName("Monika");
encaps.setrollNo(56);
//Get data using getter methods of Encaps class.
System.out.println("RollNo : "+encaps.getrollNo()+", Name : "+encaps.getName());
}
}
Output of above example Is as bellow.
RollNo : 56, Name : Monika
Download What Is Encapsulation In Java? - Software Testing Tutorials All SVG file downloads also come bundled with DXF, PNG, and EPS file formats. All designs come with a small business commercial license. These SVG cut files are great for use with Silhouette Cameo or Cricut and other Machine Tools.