Answer:
By using the this keyword
Explanation:
The this keyword in java is used for pointing the current object or current variable .The this keyword is removing the ambiguity among the characteristics of the class as well as the variables with the similar name.
In the given question if the class student has member variable gpa also we have a method having the argument gpa with the help of this keyword we can refer the gpa variable inside the method .
Following are the implementation of the given question
public class Main // main class
{
int gpa; // variable declaration
public Main(int gpa) // constructor
{
this.gpa = gpa; // this keyword
}
public static void main(String[] args) // Main method
{
Main m= new Main(55); // creating object of class
System.out.println("The Value of gpa is : " + m.gpa); // display value
}
}
Output:
The Value of gpa is :55
A method that returns a string in the form of the hour: minute: second for a given total second that utilizes the given header is as follows:
class Convert {
public static String format(long seconds) {
Scanner sc = new Scanner(System.in);
System.out.print("Enter total seconds: ");
int secs = sc.nextInt();
int hours = secs / 3600;
int minutes = (secs % 3600) / 60;
int seconds = (secs % 3600) % 60;
String timeFormat = hours + ":" + minutes + ":" + seconds;
return timeFormat;
}
}
<h3>What is the String function?</h3>
The string function may be characterized as the type of function in a computer's programming function that may significantly have a non-numerical result.
String functions are typically utilized in computer programming languages in order to manipulate a string or query information about a string successfully.
Therefore, a method that returns a string in the form of the hour: minute: second for a given total second that utilizes the given header is well described above.
To learn more about Header, refer to the link:
brainly.com/question/2329500
#SPJ1
Computer-integrated manufacturing is the manufacturing approach of using computers to control the entire production process