Skip to content

Updated the Repo fully #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# Java-School
# Name of the Repo
Java-School
# Short Description of The Repo
A guide to learning the key concepts in Java programming language in One Month

# Requirements
- You must have a laptop
- You must have Eclipse installed on your laptop(you can search online for how to install eclipse)
- You must know simple arithmetics
- You should have internet access, be eager to learn and to create new things
# Objectives of the course
- Make student understand the rudiments of Java and programming in general
- Teach students in a project oriented format
- Produce guys who can and are ready to solve the worlds problem through programming
# How to Use The Repo
This Repository will include
- Links to videos
- Links to Book Downloads
- Links to Projects and Projects Samples

We are going to be using one main material for this course, which is Java How to Program and i added it here.
# Credit
- Codebag Team
# Compensate Us
You can only compensate us by starring and watching this repository. So that you can get updates on the repo. Following us on Twitter, Facebook and Instagram @codebagNG will be appreciated.
# Note
This repo is just a means of touching what we are going to be doing briefly. For better understanding of what we are touching here students are advised to follow the tutorials and do the mini-projects
1 change: 0 additions & 1 deletion Section F/Task.md

This file was deleted.

20 changes: 0 additions & 20 deletions Section H/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Section H/Task.md

This file was deleted.

19 changes: 0 additions & 19 deletions Section I/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Section I/Task.md

This file was deleted.

7 changes: 0 additions & 7 deletions Section J/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions Section J/Task.md

This file was deleted.

5 changes: 0 additions & 5 deletions Section K/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions Section K/Task.md

This file was deleted.

7 changes: 0 additions & 7 deletions Section L/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Section L/Task.md

This file was deleted.

7 changes: 0 additions & 7 deletions Section M/README.md

This file was deleted.

1 change: 0 additions & 1 deletion Section M/Task.md

This file was deleted.

28 changes: 28 additions & 0 deletions Task A/Content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
This part of the course is to introduce you to the folowing facts
1. Computers are made up of two major parts(Hardware and Software) Hardware is the physical component, and the software are the programs and set of organised instructions that is needed by this hardwares to perform there functions
2. Operating System is the main software which the computer, its hardware and its user needs to interact with the computer. We have different types of Operating System e.g Windows(which is proprietary{research on proprietary software}), Ubuntu(Open Source)
3. Then we have programming languages that is responsible for writing the instructions that this computers uses to perform the functions they are the meant to perform and an example of this programming language is Java others are Python, JavaScript
4. The most popular first program of every programmer is the Hello World program and we are going to do just that
```
public class Hello
{
public static void main(String[] args)
{
//This is a one line comment
/*And here comes the
the multiline comment*/
/*And here we have the JavaDoc
comment which is also multiline**/

System.out.println("Hello World");
/*The above code prints out hello world on the screen take note of the structure, all letters before the parentheses in lower case except the "S" in System and the double inverted commas*/


}
}
```
5. Java Memory concepts entails garbage collection in java and it is basically the language's way of freeing up resources. You should research more on it because very much it will form the basis of how your program will be efficient
6. Decision making is one of the core of all programming languages and some operators are peculiar with it. These operators are shown below
1. Equality operators are ==(equivalent to equals to) and !=(equivalent to not equals to)
2. Relational operators are >(greater than), <(less than), >=(greater than or equals to), <=(less than or equals to). Check the reference material to know more about how relational and equality operators are being used

2 changes: 1 addition & 1 deletion Section A/Task.md → Task A/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(Test Drive: Carbon Footprint Calculator) Some scientists believe that carbon emissions,
especially from the burning of fossil fuels, contribute significantly to global warming and that this
canbecombattedifindividualstakestepstolimittheiruseofcarbon-basedfuels.Organizationsand
can be combatted if individuals take steps to limit their use of carbon-based fuels .Organizations and
individuals are increasingly concerned about their “carbon footprints.” Websites such as TerraPass
www.terrapass.com/carbon-footprint-calculator/
and Carbon Footprint
Expand Down
File renamed without changes.
48 changes: 48 additions & 0 deletions Task B/Content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Introduction to Classes, Objects and Objects

In this Section we will be taking an Introduction to Classes, Objects and Methods. You can view a class as a blueprint of a car(design of a car), and we all know that a car's blueprint cannot move or convey anything unless the blueprint is converted into a real car, that is where the concept of object comes in, in which an object of a car is an instance of class, having all the abilities portrayed by the class. And then we have methods which can be viewed as the different mechanism of functioning of a car in the car analogy, like the breaking mechanism, the gear mechanism e.t.c. So the method of a class, also has a representation in the classes's object as the design of a car's blueprint gear, braking mechanisms e.t.c has a real representation in the real life.

# Declaring and Instantiating a class with method

Declaring a class

```
//Book.java,
//Class declaration with one method.
public class Book //A class declaration
{
// display a welcome message to the GradeBook user
public void displayMessage()
{
System.out.println( "Welcome to the Grade Book!" );
} // end method displayMessage
} // end class Book
```
Instantiating an object of a Class

```
//BookTest.java
// Creating a Book object and calling its displayMessage method.
public class BookTest{ //Take Note of the name of the file name and the class name(note BookTest.java is the file name)
// main method begins program execution
public static void main( String[] args )
{
// create a Book object and assign it to myBook
Book myBook = new Book();
// call myBook's displayMessage method
myBook.displayMessage();
} // end
} // end class BookTest
```

# Instance variables of a Class
Instance variables can be viewed as the attributes the created object is going to have, like in the car analogy, the color of the car, the fuel tank e.t.c. Note that instance of class is the class's Object




Those are the basics of this section, for the other parts and more on the part we have discussed we are going to be using our reference material, the internet and the tutorial videos together.




File renamed without changes.
File renamed without changes.
29 changes: 29 additions & 0 deletions Task C/Content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Classes and Objects: A Deeper Look


1. Time Class Case Study
As an introduction to this course we are going to study a time class ase study, and we should know that this case study is going to be taken from our reference material. The course we are taking presently can be found in the chapter 8 of the material given, the explanation of what was done there will be discussed in the tutorial.

2. Controlling Access to Members, this reference, package access
From our previous classes we somethings about a class, the fact that a class uses methods and the fact that we have instance variables too which serves as a kind of the attribute of the class and its objects. All this methods, instance variables, and other variables are members of a class. Note: A variable is generally anything we store something inside in our class example is shown below

int x = 30;
String name = "Femi";
This variables can be accessible to all methods in a class, that is when we have them as instance variables. And they can be restricted to a particular method in a class, then we call them local variables.
When creating a java file the folder the java file is inside is regarded to as its package, and every others java files inside that folder are in the same package. And as to that we have something called package access, which defines if a member of a class can be accessed by any other class in the package. The stuffs that declare the package and general access of a class's members are called ACCESS MODIFIERS, and the different access modifier and there access level are given below

public - can be accessed by any other program anywhere in the system
private - can only be accessed inside the class where it is declared
protected - can be accessed by the subclass(we will discuss subclass later) and the classes in the same package with a class
default - Can only be accessed by the classes in the same package with the class where the member is declared

From the above we can see that all members declared as public, default and protected can be accessed by other classes in the same package.
This reference is used refer to a member of a class when we have an intefering member from outside that has the same name with the particular member. This reference is best understood when we use it in a class


3. A class's constructor can be seen as a type of method that is used to initialize a class by telling the caller method what is necessary to initialize a class, we have overloaded constructor when we have more than one constructor for a case where the intialization of a class can have different set of initializer which we call the constructor's parameter. We have a default constructor when the class doesn't need a constructor argument, this is almost the same as No-argument constructor. Set and Get methods are conventional naming style for some set of methods where the set method from its name is meant to set a value for one or more instance variables and the get method is a method that return the instance variable that has been set by the set method.

4. Garbage Collections has been touched briefly in the first lesson and we see it as a means of resource management by a program where the resources that is no more in use is freed and method finalize is one of the methods used in doing this. Compositions and Enumerations is best described in the tutorial videos.

5. Anything static is used to refer to members of a class that doesn't need an initialization of the object of the class before using and having access to the member. Final is used to declare a member that should not change in the course of the program and it is mostly used to intialize a constant
6. In the final time class case study in our reference material all the concepts we have discussed above is put into practical use.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions Task D/Content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Control Statements

And here we have it we are in my most interesting topic in programming which is control statements. My definition of control statement is that it is the brain of the program in that it contains the decision making mechanism of a program. Control statements or control structures can be grouped into 3 major parts

- Sequence - This is the mechanism carried out by the compiler and the system itself and it is a type of mechanism that defines that a program follows a sequence of execution based majorly on the sequence in which the code is written. It is basically what comes first get executed first

- Selection - This is the decision making mechanism of the program. And the different selection control statements we have are:
1. if statement
2. if-else statments
3. switch statements

There usage is shown below:
if statement
if(5>0)
System.out.print("Five is greater than 0");

if-else statement
if(5<0)
System.out.print("Five is less than 0")
else
System.out.print("Five is greater than 0")
Switch is best shown in a real program but what it basically does is that it takes a value and checks for the different cases of the value. Like it can take a number and check if it is 5, 4, 3, using switch and case and provides for what should happen if the value is any of the values in the different cases.

Pseudocode is a false code from its name pseudo-false and code, and it is basically a way of simplifying the code that is to be written in more human readable language. It helps to define the flow of the program and what should be done at any point. Note: pseudocode is not compiler-readable(a compiler is what converts your code to machine code, a java compiler converts its code to bytecode which is platform independent, which makes java a write once, run anywhere)

# Algorithms
Algorithm is the order and action that you specify your program to carry out. A very good algorithm follows a very good order and performs an action in the most optimal way. Algorithm is like the routine your program passes through to do what it is supposed to do. In getting the algorithm for your program do well to not follow the wrong other like using an object to a variable before creating the object because this will cause a logical error in your code.

Operators and Structured programming will be discussed in our tutorial sessions


File renamed without changes.
File renamed without changes.
Empty file added Task E/Content.md
Empty file.
File renamed without changes.
File renamed without changes.
27 changes: 27 additions & 0 deletions Task F/Content.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Arrays and Introduction to Data Structures

1. Declaring and Initializing an Array
Array is a basic data structure in java, it is used to store a list of data that cannot change. Its declaration and initialization is shown below

int[] array1 = new int[4];//Array declared to have a length of 4
array = {1,2,3,4};//Array initialized with the elements inside the curly bracket
int[] newArray = {1,2,3,4};//Array declared and initialized

2. Multidimensional Array
The array we created above is an array with single row and single column, but java provides for more flexibility in that we can have an arrays of multiple columns for each row, these arrays can be declared and initialized as shown below.

int[][] array = new int[3][4];//This is a 3 by 4 array with 3 rows and 4 columns and can be visualized as a table.
array[0] = {1,2,3,4};//This is initializing the first row of the array with the elements in the curly bracket. Using array[0] on a normal array will give you the first element of the array, so in the first array we created above array1[0] equals to 1. Note: Counting in most programming languages starts from 0 for the first element.
array[0][0];// this will return the element in the first row and first column and this element is 1.

3. class Arrays
Class Arrays is an inbuilt Java class that provides for more manipulations of an array. Before you can use the class Arrays you have to import it, you import it before the class declaration and it can be imported as shown below.
import java.utils.Arrays;
After importing and declaring the classes and the methods needed you can now start using the class as shown below
Arrays.equals(array1,array2);//This checks if two arrays are equal
Other methods of class Array will be explored in the tutorial classes.

4. Collections is a compilation of data structures in java ranging from ArrayList to Maps to queues e.t.c. ArrayList is a mutable list that is a list that can change at runtime. Collections and ArrayList are best understood when used in practical applications and we will touch it briefly in our tutorial classes

5. We will explore the card shuffling and dealing simulation as shown in the reference material we are using

1 change: 1 addition & 0 deletions Task F/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write the card shuffling and dealing simulation program as shown in the Chapter 7 of Java How to Program on your. Take Note: Do not follow them verbatim.
File renamed without changes.
Loading