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
Consider the following class interfaces:
o-na [289]

Answer:

class teacher and student I didn't actually read it but I think it is class student

6 0
3 years ago
How frequently should computers containing ehr information be backed up?
geniusboy [140]
Explain what is meant by a limited data set and how this HIPAA rule may affect medical assistants
7 0
3 years ago
LILLE VIC LUNCUL ANCI.
tatiyna

The correct option is C. toward the floor.

The magnetic force on the moving negative charge acts towards the floor.

<u>Explanation</u>:

The direction of the force applied on the moving charged particle placed in the magnetic field can be determined with the help of Fleming’s Left hand rule.

The current flows in the direction opposite to the direction of electron. If the electron moves from negative terminal to positive terminal, then the current will flow from positive terminal to negative terminal.

As given, the direction of electron- South to North

So the direction of current will be- North to South

Using Fleming's Left hand rule we get the direction of force in downward direction, i.e. towards the floor.

5 0
3 years ago
What type of cable is used to connect a workstation serial port to a cisco router console port?
butalik [34]

a <span>Ethernet-<span>Cable is a how to put it together</span></span>

<span><span /></span>

6 0
3 years ago
Microsoft, Intuit and, Yahoo are building new facilities in Quincy, WA, a town that previously had a population of 3,500. Along
sveticcg [70]

Answer:

Economic.

Explanation:

In the following scenario, In Quincy, WA, a community that formerly would have a community of 3,500, they are developing new infrastructure. In addition to such friends and neighbors, Quincy citizens will also be seeing more traffic signals, a shopping center, rising property prices, and new opportunities.

So, the following scenario is best suited for the economic changes.

5 0
3 years ago
Other questions:
  • Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest
    10·1 answer
  • Technological _____ is the term used to describe the merging of several technologies into a single device.
    13·1 answer
  • 1. The best program to present numerical data in would be ____. a. Access c. PowerPoint b. Excel d. Word
    6·1 answer
  • Huffman trees use the _________ of each character to work out their encoding. A) Frequency B) Order in ASCll
    12·1 answer
  • How do medical detectives investigate their cases?
    15·2 answers
  • Yuygiihjiujjhuuuuykjyt​
    13·1 answer
  • Josh wrote the following e-mail to his co-worker. PLEASE HELP QUWICK
    5·2 answers
  • 3.<br>Give two reasons why everyone should study technology<br>​
    10·1 answer
  • 2. How much did John Jones have in his account on the first day of the
    5·1 answer
  • Zoe wants to post something controversial online, but then she remembers that employers may look at her social media when she st
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!