0% found this document useful (0 votes)
3 views1 page

Java Basics: Main Method & OOP Concepts

The document discusses the main method signature in Java and object-oriented programming concepts like classes, interfaces, packages, encapsulation, and inheritance. It notes the main method signature is public static void main(String[] args) and defines the purpose of comments, fields, and methods in software objects. Common terms like API and GUI are also defined.

Uploaded by

Grace Yeo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Java Basics: Main Method & OOP Concepts

The document discusses the main method signature in Java and object-oriented programming concepts like classes, interfaces, packages, encapsulation, and inheritance. It notes the main method signature is public static void main(String[] args) and defines the purpose of comments, fields, and methods in software objects. Common terms like API and GUI are also defined.

Uploaded by

Grace Yeo
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Getting started

/** documentation /
/* comments
// comment until end of line

The signature of the main method is public static void main(String[] args)

When declaring the main method, the modifiers public and static can be in either order, but the
convention is public static.

The main method defines a single parameter, usually named args, whose type is an array of String
objects.

Object-Oriented Programming

Real world objects contain state and behavior.

A software object’s state is stored in fields.

A software object’s behavior is exposed through methods.

Hiding internal data from the outside world, and accessing it only through publicly exposed methods
is known as data encapsulation.

A blueprint for a software object is called a class.

Common behavior can be defined in a superclass and inherited into a subclass using the extends
keyword.

A collection of methods with no implementation is called an interface.

A namespace that organizes classes and interfaces by functionality is called a package.


A String object contains state and behavior for character strings
A File object allows a programmer to create, delete, inspect, compare, or modify a file on the
filesystem
A Socket object allows for the creation and use of network sockets

The term API stands for Application Programming Interface.


The term GUI stands for Graphical User Interfaces

You might also like