Explain the member access separator, JAVA Programming

Assignment Help:

Explain the Member Access Separator ?

class Car {

String licensePlate; // e.g. "New York 543 A23"
double speed; // in kilometers per hour
double maxSpeed; // in kilometers per hour

}
Once you've constructed a car, you need to do something along with it. To access the fields of the car you use the . separator. The Car class has three fields
• licensePlate
• speed
• maxSpeed
Thus if c is a Car object, c has three fields as well:
• c.licensePlate
• c.speed
• c.maxSpeed
You use these only like you'd use any other variables of the similar type. For example:
Car c = new Car();

c.licensePlate = "New York A45 636";
c.speed = 70.0;
c.maxSpeed = 123.45;

System.out.println(c.licensePlate + " is moving at " + c.speed +
"kilometers per hour.");
The . separator selects a exact member of a Car object through name. 


Related Discussions:- Explain the member access separator

Solving problems about traffic jam, Computer programming Project Descrip...

Computer programming Project Description: Solving various problems about traffic jam Skills required: C# Programming, Java, C++ Programming, PHP, Software Architecture

Explain in brief java applet, Explain in brief Java applet? It is a...

Explain in brief Java applet? It is a java program. It has been designed for transmitting Java code over the internet. It's automatically executed by Java-enabled W

Explain arithmetic promotion and binary operations, Explain Arithmetic Prom...

Explain Arithmetic Promotion and Binary Operations? An int divided through an int is an int, and a double divided by a double is a double, but what about an int divided by a do

Servlet, i nedd servlet basics

i nedd servlet basics

What is pop, The Post Office Protocol is an application-level protocol with...

The Post Office Protocol is an application-level protocol within an intranet which is used by the local e-mail clients to send and retrieve e-mails from a remote server those are l

K-means clustering, i) Set the number of data points to 20 and the number o...

i) Set the number of data points to 20 and the number of clusters to 2. Check box Show History. Click on Initialize. Click on Start. Click on Step . Observe which points ch

The software or script to scan automotive ads, The software or script to sc...

The software or script to scan automotive ads Project Description: Looking for a company that made the script or application to search through pages of listings of automotive

What is an iterator, What is an Iterator? Some of the collection classe...

What is an Iterator? Some of the collection classes give traversal of their contents via a java.util.Iterator interface. This interface permits you to walk through a collection

Explain primitive data types in java, Explain primitive data types in java?...

Explain primitive data types in java? Java's primitive data types are extremely similar to those of C. They involve boolean, byte, short, long, int, float, double, and char. Th

What is setter methods explain with an example, What is Setter Methods expl...

What is Setter Methods explain with an example? Setter methods, also called as mutator methods, merely set the value of a field to a value specified through the argument to the

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd