Basics of Java Pt.1
Basics of Java
There are things
to remember when using Java and when writing code.
- Keywords
- What is an object?
Keywords
In
Java programming, keywords are reserved words that have predefined meaning in
the language. Programmers cannot use keywords as name for variables, methods,
classes, or as any other identifier. For example keywords are: abstract,
assert, Boolean, break, byte, case, class, do, final, do and etc.
What is an object?
Objects
are key to understanding object-oriented technology. Look around right now and
you'll find many examples of real-world objects: box, dog, bicycle, computer
and etc.
Real-world
objects share two characteristics: they all have attributes and behavior.
For example a dog
Attributes
would be black, blue eyes, big, long tail, paws and etc.
Behaviors
would be barks, run, eat, sleep and etc.
When
we start coding, we assign objects with keyword class basically name of
object. For example;
Public
class cube {
- Then “cube” is the name of the object
Remember
we can’t use keywords as objects like
Public class class{
}
- This will you give you any error
loved your blog. java training in chennai
ReplyDelete