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
nevsk [136]
3 years ago
14

Data hiding, which means that critical data stored inside the object is protected from code outside the object, is accomplished

in Java by: __________
Computers and Technology
2 answers:
Klio2033 [76]3 years ago
4 0

Answer:

using the private access specifier on the class fields.

Explanation:

We can protect the data stored inside the object from the code outside in java by using the private access specifier on the class fields.

If the any class field is declared private it is not accessible to the objects outside that class.Private member are also not inherited in inheritance.

oee [108]3 years ago
4 0

<em>using the private access specifier on the class methods  </em>

<h2>Further explanation </h2>

Java is an OOP (Object Oriented Programming) paradigm programming language that can be run on computers with 32-bit or 64-bit systems. One software that operates the Java programming language is NetBeans IDE 7.2.

Private is the code that matches the name, this access is private. in other words, data and methods can only be accessed by the class they have.

Protected is an access code that makes a data or method that is defined with this level of access can be accessed by classes that have it only and also classes that include having descendants or Encapsulation data

Private Access

<em>public class StudentRecord </em>

<em>{ </em>

<em>         // basic access to variables </em>

<em>         private int name; </em>

<em> </em>

<em>          // basic access to the method </em>

<em>          private String getName () { </em>

<em>                      return name; </em>

<em>           } </em>

<em>} </em>

<em> </em>

In the example above, the variable name and the method getName () can only be accessed by the internal methods of the class.

Protected Access

<em>public class StudentRecord </em>

<em>{ </em>

<em>         // access to variables </em>

<em>         protected int name; </em>

<em> </em>

<em>          // basic access to the method </em>

<em>          protected String getName () { </em>

<em>                      return name; </em>

<em>           } </em>

<em>} </em>

In the example above, the variable name and the getName () method can only be accessed by internal class methods and subclasses of the StudentRecord class.

Learn More

private protected in Javascript brainly.com/question/13133829

method and class in javascript brainly.com/question/13148975

Details

Class: High School

Subject: Computers and Technology

Keywords: javascript, private access, protected

You might be interested in
In statistics the mode of a set of values is the value that occurs most often. Write a program that determines how many pieces o
Feliz [49]

Answer:

  see below

Explanation:

The program of interest is the function "findMode[x, n]" in the attached. It is written the Wolfram Language of Mathematica.

The basic idea is that the data in the array is sorted. The sorted array is partitioned into sets of identical elements, and the number in each of those sets is counted. The maximum of those counts is the mode. The location of the maximum count corresponds to the location of the set having that count. We use that location information to pull out the mode value(s).

If there is more than one mode, all are reported.

__

An example data array is provided, along with the program output.

6 0
3 years ago
When is an original work considered public domain?
Blababa [14]

The correct answer isn’t really a choice shown. I would choose D because if a work doesn’t have a copyright symbol that doesn’t mean it’s in the public domain. In a real life situation it would be best to ask the creator before you use their work. If they say it’s in the public domain then you’re fine, but even if they say you can use it that doesn’t mean it’s in the public domain, it just means that you have permission to use it.

7 0
3 years ago
Can we change our profile name on here and how
TiliK225 [7]
Only by making a new account
4 0
3 years ago
Read 2 more answers
Lisa and her husband would like to buy a house soon. She continuously pays bills late. How do her actions affect her and others?
stiks02 [169]
Well actually it affects her credit. Home owners would not want to sell a house to someone who doesn't pay bills on time. It shows he/she is unreliable

3 0
3 years ago
Read 2 more answers
Write, compile, and test the MovieQuoteInfo class so that it displays your favorite movie quote, the movie it comes from, the ch
Irina18 [472]

Using the knowledge of computational language in JAVA it is possible to write a code that removes your favorite phrase from the movie. It consists of two classes in which one is driver code to test the MovieQuoteInfo class.

<h3>Writing code in JAVA:</h3>

<em>public class MovieQuoteInfo { //definition of MovieQuoteInfo class </em>

<em> //All the instance variables marked as private </em>

<em> private String quote;</em>

<em> private String saidBy;</em>

<em> private String movieName;</em>

<em> private int year;</em>

<em> public MovieQuoteInfo(String quote, String saidBy, String movieName, int year) { //parameterized constructor </em>

<em>  super();</em>

<em>  this.quote = quote;</em>

<em>  this.saidBy = saidBy;</em>

<em>  this.movieName = movieName;</em>

<em>  this.year = year;</em>

<em> }</em>

<em> //getters and setters </em>

<em> public String getQuote() {</em>

<em>  return quote;</em>

<em> }</em>

<em> public void setQuote(String quote) {</em>

<em>  this.quote = quote;</em>

<em> }</em>

<em> public String getSaidBy() {</em>

<em>  return saidBy;</em>

<em> }</em>

<em> public void setSaidBy(String saidBy) {</em>

<em>  this.saidBy = saidBy;</em>

<em> }</em>

<em> public String getMovieName() {</em>

<em>  return movieName;</em>

<em> }</em>

<em> public void setMovieName(String movieName) {</em>

<em>  this.movieName = movieName;</em>

<em> }</em>

<em> public int getYear() {</em>

<em>  return year;</em>

<em> }</em>

<em> public void setYear(int year) {</em>

<em>  this.year = year;</em>

<em> }</em>

<em> //overriden toString() to print the formatted data</em>

<em> public String toString() {</em>

<em>  String s = quote+",\n";</em>

<em>  s+="said by "+this.saidBy+"\n";</em>

<em>  s+="in the movie "+this.movieName+"\n";</em>

<em>  s+="in "+this.year+".";</em>

<em>  return s;</em>

<em> }</em>

<em>}</em>

<em>Driver.java</em>

<em>public class Driver { //driver code to test the MovieQuoteInfo class</em>

<em> public static void main(String[] args) {</em>

<em>  MovieQuoteInfo quote1 = new MovieQuoteInfo("Rosebud", "Charles Foster Kane", "Citizen Kane", 1941);//Create an object of MovieQuoteInfo class</em>

<em>  System.out.println(quote1); //print its details </em>

<em> }</em>

<em>}</em>

See more about JAVA at brainly.com/question/12975450

#SPJ1

7 0
2 years ago
Other questions:
  • You have an insurance policy with a $300 premium and a $500 deductible. How much should you expect to pay the insurance company
    15·1 answer
  • 4. How can you select non-adjacent cells (i.e. cells that are not all together in one block)?
    5·2 answers
  • Imagine that the following two lines of code are placed inside a
    11·1 answer
  • A company has recently learned of a person trying to obtain personal information of employees illegally. According to which act
    15·2 answers
  • write a program with total change amount as an integer input and output the change using the fewest coins, one coin type per lin
    8·1 answer
  • Marie has never used a word processor. In 3 to 4 sentences, describe how she could benefit from using a word processor to comple
    7·2 answers
  • Evonka is listening to music from an online music provider (such as Pandora or Jango). She builds a list of music preferences, i
    15·1 answer
  • You have a large TCP/IP network and want to keep a host's real time clock synchronized. What protocol should you use?
    10·1 answer
  • Pls help. will give brainliest to FIRST and CORRECT answer!
    14·1 answer
  • 2. When a business practices offensive behavior, you have many options. The option with the loudest voice is
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!