Tip:
Highlight text to annotate it
X
Hello and welcome to cc11rocks' third Java video
tutorial. Today, I will be discussing the Java API,
which stands for Application Programmer's Interface.
I originally created this video in Windows a year and a half ago. I am redoing this video because I now have the ability
to record in HD and I have added a new, important section.
Geez. There are thousands of these things. What are they?
Arctic up here
They're classes. That looks familiar.
We are making classes. Yep, they are exactly the same.
We can use these public classes because their
access modifiers are public, just like ours. This means that they have public classes and methods.
All these classes are included in the JRE for you. They are already written and compiled too.
f you type in "Java 7 String", then
the API specification information for the class String will be available to you,
which someone already wrote. When we get to the page,
it looks very complex. There are all these things. Something called
constructors... There are..methods.
Didn't we use this in our previous tutorials?
Yes, we did. We can use these methods by following the API standards.
The constructor is used to similar to how a method is used, but allows you
you to create an instance of this class.
This means that you are creating a new object, usually using the keyword "new".
So, this is the standard for constructors.
"type, variable, equals, new type, and parameters."
These are all explained in the specifications here.
So, for example, you can have a constructor with no arguments,
which will complete the default action. In the case of a method with type string, it will assign the default value, meaning it does not have a value.
You can also have a constructor WITH arguments.
String (String Original)
is an example of a constructor with arguments. If we do not know what this means,
we can click on the provided hyperlink
It is saying that original is a String. So basically, we can put a String inside the quotes, and it will pass the argument, creating a new variable with the assigned variable of original.
Newly initialized object that represents the same sequence characters in the argument the
In other words, the newly created string is the argument string,
unless an explicit copy of String is created, it is unnecessary since strings are immutable.
It also tells us that our
parameters are a string.
So, we can basically put a string inside the parenthesis in quotes and
creating a new variable the assigned variable original
except is whatever you put closer this class is so calm Java developers
is special syntax for few basic types is
int which is short for integer string double
which is another now function constructors not explicitly needed
although we can still use which is
skip the constructor the street as is specialty
however this is not you other missile issue for strings because
very calm years doctor laureates
so assist like variable
same type equals you serene
arguments so this is
found in the
area this is the constructor music so
this sign I even tells you
he signs to
so here's demonstrating
is string original those
originally a Street here which is what I miss
do and this is a special syntax his first re so
can only do this for tapes tree is world
so for now artistic structures located in the API
you will what they are so so it two strings
guess festered real password which contains trace
house for one and password to want to know if there's
same so ago the string API there is a mythical
equals located here this value on the left
tells you it's Richard so
when you call this you figure out what he's doing you sir Richard
in this case is coolly billion with the lower case
be use tools senses industry
Street done equals object an object whenever an object is
with us a look at prisoners for market
click on equals so so you this feature value:
this public so weak use it week but some kinda objected
in this case string return true
there's same balls their strings
sold here
so here said guess equal
past one using basic constructor here
it will pass us to notice
sizzle this is a special way to set a string
so lean is that right ruling is
to balls but this is a tight is a rate this is our variable
equals guess house so this is a street value dodi closest
string so this is a string think
years screen equals
others equals
real fast so this is now
if the Eagles each other its gonna sit this
to true not said full so now we go ahead
school in Valley so sleepy to
falls so here
itself falls because house one does not equal us for two
notice if this works good changed
said surgical to each other consult true
because house for one doesn't house
now this is cases sure there's an element that you could say
all que tal case so don't go well
this is Kapil lower case the but in this case
it is cases so if they equally exactly
the same number letters the same values
it will true sizes value
so goes to class tree
is a message equals in that method
say okay returning value true or false the side
value is a great which is a type 2 finally
in the Java API their ames called constant field values
for certain classes you use the constant field values
the tape static I'm this means that the values cannot be changed
associate with the class brother individual for example to set a bold
value for use the concept value
fun double look at the park a PSS
K here we can see feel sorry
is feels this case
there's a poll years which is being used here
so museum basic constructing here
to create very good news for close
so we don't know what really goes on here this second value
is some kinda style
which this happens yes style
so use this with call part
Lee this case play dorsey's bold
not work as well
basic uses this is class
and whatever this is is both static
final know uses
it would be its value hi example
map hi so here's the math class
each other API here a
static feel called hi
sewing uses likely up
named the club's done you
static field which is
here so if you set this to a double value
which is what this is here this means a floating-point number
has it does hopefully for the cell ok rounded value
this isn't the actual despised
going right his around value summer closed fine
two examples farms use it math class
there's plenty of the classes you can use it so this is the very basis
used each other AP a the next video we discuss
April dated such as lean is
double all found throughout this
ok enjoy the video is like and favorite this video this is going to chill
make sure to get might be asleep currently producing videos
spare time Java programming licks related tutorials
his thank you