1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
PilotLPTM [1.2K]
3 years ago
14

Create a class 'ProblemSolution' with following characteristics A public method 'solution' without parameters and return type is

int. Create object of class 'Student' inside 'solution' method and return the value of ""rollNumber"" from the class 'Student'.
Computers and Technology
1 answer:
Rus_ich [418]3 years ago
8 0

Answer:

The program to this question as follows:

Program:

class Student //defining class student

{

int rollNumber=1001; //defining integer variable rollnumber and assign value

int value() //defining method value

{

return rollNumber; //return value

}

}

public class ProblemSolution extends Student //defining class problemSolution that inherits Student

{

int solution() //defining method solution

{

Student stu=new Student(); //creating student class object

return stu.value(); //call function using return keyword  

}

public static void main(String ax[]) //defining main method

{

int result; //defining integer variable result

ProblemSolution ps=new ProblemSolution(); //creating class object

result=ps.solution(); //holding value of solution function

System.out.println("rollNumber value is: "+result); //print value

}

}

Output:

rollNumber value is: 1001

Explanation:

In the above java code two-class "Student and ProblemSolution" is defined, in which student class an integer variable rollNumber is defined, that holds a value "1001", and inside this class, a method "value" is defined, that return above variable value.

  • In the next step, class "ProblemSolution" is defined, that inherits the student class, inside this class two method "solution and the main method" is defined.
  • Inside the solution method, the student class object is created and this method uses the return keyword to call the student class method "value".
  • In the main method, an integer variable "result" is defined, which holds its method "solution" value and uses print function to print its value.
You might be interested in
What's a big question or problem in the tech field you'd like to solve and why?
aleksandrvk [35]

A big question or problem in the tech field that i would like to solve is Data security.

<h3>What is Data security ?</h3>

Data security  can be regarded as process of protecting data from unauthorized user as well as protection from  data corruption .

I will like to solve this problem because as advances in technology, the data of individual or organization is not been total secured and this is posing so much loss to individuals.

Data security are;

  • data encryption
  • hashing
  • tokenization

Learn more about Data security at;

brainly.com/question/17493537

5 0
2 years ago
What occurs when information is copied from an internet source to another computer?
Margarita [4]
The answer is pasting
3 0
3 years ago
In the retrieval phase of Godden and Baddeley (1975) study of the encoding specificity principle, participants were asked to sup
kicyunya [14]

Answer:

recall

Explanation:

Based on the scenario being described within the question it can be said that this was a recall measure of memory. In the field of neuroscience, a recall test refers to a type of test in which subjects are shows a certain stimuli and are later asked to remember as many stimuli as they can. Which in the case of the Godden and Baddeley (1975) study the stimuli were a set of words that were shown to the subjects.

5 0
3 years ago
a document contains a list of items that appear in no particular order. what is the best way to format the list
krok68 [10]

Answer:

bulleted list

Explanation:

8 0
2 years ago
Define the four basic operation of a computer ​
Alexeev081 [22]

Answer:

input, output, processing, and storage.

Explanation:

input - the transfer of information into the system. ( ex: what you type on a keyboard. )

output -  the presentation of information to the user ( example is the screen. What type of display is presented...?)

processing - obtaining  information based on what you you searched ( What search results you get after putting in the input)

Storage - Storing or saving information into files.

6 0
2 years ago
Other questions:
  • A person planning to file for bankruptcy must receive credit counseling within two years before filing the petition.
    7·1 answer
  • Your boss in the human resources department asks you to write a function that calculates the length of time that employees have
    6·1 answer
  • Easy STEAM question :)
    15·2 answers
  • Martha wants to invite her coworkers to her birthday party. She uses the mail merge feature to compose and send the invitations.
    6·1 answer
  • What are computer virus ? Explain in detail.In your answer include symptoms and prevention (3each)
    10·1 answer
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • How many transponders are contained within a typical satellite?
    12·1 answer
  • How to convert a .enw file into a .pdf without downloading any applications? (If I have to, then I will. Just please tell me.)
    14·2 answers
  • Now you are ready to implement a spell checker by using or quadratic. Given a document, your program should output all of the co
    15·1 answer
  • How do you remove management from your chrome book [administrator]
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!