first commit
This commit is contained in:
47
Semester 1/Programming 1/Week 5/Workshop 5/test.java
Normal file
47
Semester 1/Programming 1/Week 5/Workshop 5/test.java
Normal file
@@ -0,0 +1,47 @@
|
||||
|
||||
/**
|
||||
* Write a description of class test here.
|
||||
*
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
public class test
|
||||
{
|
||||
// instance variables - replace the example below with your own
|
||||
private int sum1, sum2;
|
||||
private float number;
|
||||
private double total;
|
||||
|
||||
public void modify( int num )
|
||||
{
|
||||
num = 10;
|
||||
System.out.println( num );
|
||||
}
|
||||
|
||||
modify();
|
||||
|
||||
/**
|
||||
* Constructor for objects of class test
|
||||
*/
|
||||
public test()
|
||||
{
|
||||
// initialise instance variables
|
||||
sum1 = 10;
|
||||
number = 2.5f;
|
||||
sum2 = 20;
|
||||
total = 10.25d;
|
||||
}
|
||||
|
||||
/**
|
||||
* An example of a method - replace this comment with your own
|
||||
*
|
||||
* @param y a sample parameter for a method
|
||||
* @return the sum of x and y
|
||||
*/
|
||||
public float sampleMethod()
|
||||
{
|
||||
// put your code here
|
||||
number = sum1 / sum2;
|
||||
return number;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user