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
OlgaM077 [116]
3 years ago
8

Define a constructor as indicated. Sample output for below program:Year: 0, VIN: -1Year: 2009, VIN: 444555666// ===== Code from

file CarRecord.java =====public class CarRecord {private int yearMade;private int vehicleIdNum;public void setYearMade(int originalYear) {yearMade = originalYear;return;}public void setVehicleIdNum(int vehIdNum) {vehicleIdNum = vehIdNum;return;}public void print() {System.out.println("Year: " + yearMade + ", VIN: " + vehicleIdNum);return;}// FIXME: Write constructor, initialize year to 0, vehicle ID num to -1./* Your solution goes here */}// ===== end ===== //===== Code from file CallCarRecord.java =====public class CallCarRecord {public static void main (String args) {CarRecord familyCar = new CarRecord();familyCar.print();familyCar.setYearMade(2009);familyCar.setVehicleIdNum(444555666);familyCar.print();return;}}// ===== end =====
Computers and Technology
1 answer:
Keith_Richards [23]3 years ago
4 0

Answer:

public CarRecord(){

       yearMade = 0;

       vehicleIdNum = -1;

   }

Explanation:

A constructor is used to initialize an object instantly. It does not have a return type and has the same name as class.

Create a constructor and set the year as 0 and vehicleIdNum as -1.

This constructor is the default constructor, initializes the default values for the variables, for this class.

You might be interested in
In programming 2+6 is an example of what math
In-s [12.5K]

Answer:

beinggreat78~here~to~help.

2 + 6 in programming is an example of math. It is the same as in the real world. Plus signs in coding are also a form of <em>string concatenaction,</em> the term used for combining two strings into one, or a variable into a string.

5 0
2 years ago
The conflict between the user’s goal for unfettered access to data and the security administrator’s goal to protect that data is
galben [10]
B it is access control
7 0
3 years ago
_____ relies on lies and misrepresentation to trick an authorized user into providing information or access to an attacker.
kap26 [50]

Answer:

"Social engineering" is the correct answer for the above question.

Explanation:

  • Social engineering is a process, which gives the idea for the hacker or unauthorized user to get inside the system or hack the system.
  • It is used to read the humans data or psychologically hack human data.
  • It teaches the processor by an attacker to be the master of the authorized user. By this, an attacker can able to know the authorized term with the help of an authorized person.
  • The above question asks about the term, which is used to help the hackers to hack the system. This term is known as Social Engineering.

6 0
3 years ago
What best describes the difference between careers and industries?
Rasek [7]

Answer:

c

Explanation:

big brain

3 0
3 years ago
Java Programming Challenge Description:Write a program that, given two binary numbers represented as strings, prints their sum i
Sunny_sXe [5.5K]

Answer:

import java.util.Scanner;

public class DecimalToBinary {

   public static String convertToBinary(int n) {

       if(n == 0) return "0";

       String binary = "";

       while (n > 0) {

           binary = (n % 2) + binary;

           n /= 2;

       }

       return binary;

   }

   public static int convertToDecimal(String binary) {

       int n = 0;

       char ch;

       for(int i = 0; i < binary.length(); ++i) {

           ch = binary.charAt(i);

           n = n*2 + (ch - '0');

       }

       return n;

   }

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       String[] words = in.nextLine().split(",");

       System.out.println(convertToBinary(convertToDecimal(words[0].trim()) + convertToDecimal(words[1].trim())));

       in.close();

   }

}

Explanation:

8 0
3 years ago
Other questions:
  • How a computer encodes text, how it is processed and how computer data is represented.
    6·1 answer
  • Why does my hp computer keep freezing when i move it?
    10·1 answer
  • Write two statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and
    7·1 answer
  • When powering up a home network, make sure all computers and peripherals are turned on before turning on the modem/router?
    11·1 answer
  • A group of computers that are interconnected in order to share information or documents is called a _____.
    13·1 answer
  • A single instruction carried out by a computer is called a what?
    5·1 answer
  • PAGE<br>DATE<br>0 What types of information should be there internet?​
    5·1 answer
  • Some of y'all make me lose braincells with your questions
    10·2 answers
  • A leading global vendor of computer software, hardware for computer, mobile and gaming systems, and
    5·1 answer
  • Can anyone help me figure out why my if statements are not executing properly? When the program executes with 7 as the value for
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!