Hello there! In this 30-Day plan we will be teaching you “How to learn Java” for free!. We know that the hardest task is to find where to learn from. But why take the burden when someone else has already done that for you? Follow along this Roadmap for the next 30-Days. In this we have gathered some of the best materials and resources for anyone to learn Java for free!
Getting to know Java!(Day-1)
Java is a general-purpose programming language that is class-based, object-oriented, and designed to have as few implementation dependencies as possible. It was developed by James Gosling in 1995. It is a platform-independent language. This means that you can run the same Java code on any device. Cool right? Also, it is based on the OOP(object-oriented) paradigm which is one of the most useful paradigms we use in programming & which we’ll talk about.
Now you must be thinking about “Why Java?” and not any other Language. Why I am supposed to learn Java in this world full of cool programming languages like Python, C++. Well yes there is a giant horde of languages out there but every language has its own perks that it offers be it python which is generally preferred when it comes to fields like Machine Learning and then there’s C++ for performance lovers but hey! We’re up to Java so why are you boasting of other languages? Well calm down, you’ll find out how beautiful development in Java can get! unlike other Programming languages, Java has some cool stuff that it provides which will excite you. So what are you waiting for!? Let’s Do This!
Note: This plan can get a bit overwhelming. But Keep going and remember that great things take time & I promise you that by the end of this you’ll become a pro-Java Developer.
Note: If you feel stuck while going through the below plan, guess what you’re on the right track because even the greatest of programmers started their journey with “hello, world!” and so you will get stuck in the process. But remember a good programmer is a person who is a pro at finding solutions. So if you ever get stuck anywhere in between, use your good old friend GOOGLE!
Quick Note about the plan: I’ve gathered some of the most useful resources for you to start programming in Java. I am sure these resources will help you a lot. But there are a lot more out there. So if you like learning from some other resource, go for it!
Damn that was boring… but now its time to get your hands dirty! Let’s go!
Setting Up Your Workspace & some basics
How does Java work?
When you run Java code into your machine what happens is that it first compiles your code into something called bytecode(machine-readable format). Then the JVM(Java Virtual Machine) compiles the byte-code and makes it Work. This mechanism makes Java “Write once, run anywhere” language. Well, that was how Java works in a nutshell. There’s a lot more going on with its working but again we don’t have to worry too much about how it works. But still if you want to know more check out the below video. Also, Check the other video which is about garbage collection in Java.
Setting up your workplace
Running Java is somewhat difficult without a good guide to follow but no worries I am going to provide you with some great resources which you can follow.
Or you can check out the video below for better understanding.
Note: I’ve listed some of resources below of installations for windows,mac & ubuntu operating systems choose accordingly to your system.
Note: Kindly check for the latest version of Java on the website as it keeps on updating so the version shown in the below video might be old but the installation shown is the same for every version.
So, now that you’ve installed the JDK successfully into your machine let’s dive deeper into ways to run Java programs.
Method-1: THE IDE(Integrated Development Environment): Well, this is generally the most useful options out there for you to run Java easily on your computer without any hassle. With its inbuilt features like IntelliSense, you can make sure that you’re programming is going to get smoother.
IDEs FOR JAVA:-
Method-2: Text Editors: Well, they provide some of the useful features IDEs provide. Besides this they also offer a variety of cool themes too!
By using the below tutorial you can run your code in VS code.so follow the video along if you prefer VS code.
Setting up Java Environment in VS code.
One more thing: You can also run your Java code via command prompt(windows),terminal(in mac & ubuntu) here’s how!
Tips to remember while working with Java:
1.) Always save the program with the name of the main class.
2.)Always give this argument to the main function “String argc”.
That’s all folks!
Also, check this out! Difference between print & println in Java: https://www.geeksforgeeks.org/difference-between-print-and-println-in-java/
Last but not the least, You’re first program in Java(made in VS code).
Let’s Learn JAVA Basics
Day-2:Variables,Data-types & operators in Java
Check out the below resources to get started!
Check out this resource: https://www.w3schools.com/java/java_variables.asp
I hope you’ve learnt enough about variables okay! so let’s move ahead! and learn
some special ones!
Some more resources for you to learn efficiently: https://www.w3schools.com/java/java_data_types.asp
Go check em’ out! Never mind let’s learn some more things!
check these out!
Whoa… that was a lot! wasn’t that & I hope you’ve learnt a lot as of now! So, see you in the next section.
Day-3: Keywords,Identifiers & stuff!
3.1 What is a Identifier in Java?
Identifiers are the names of variables, methods, classes, packages and interfaces. Unlike literals they are not the things themselves, just ways of referring to them.For example in a program of printing a “Hello,World!” which would be System.out.println(“Hello,World!”); in this program println , & “Hello,World!”(as it is a String) is an identifier.
3.2 What are keywords in Java?
In the Java programming language, a Keyword is any one of 51 reserved words that have a predefined meaning in the language; because of this, programmers cannot use keywords as names for variables, methods, classes, or as any other identifier. Of these 51 keywords, 49 are in use and 2 are not in use.
Here’s a video go check it out!
3.3 Some special keywords in Java:
Note:Well, there are some other important keywords about which we’ll talk about in the further sections.
some important info:
Day-4: String Buffer & String Builder
We’ve talked about data types in the previous sections & I think that by now you should know what are primitive data types in Java But what are String Builder & String Buffer & how’s it different from usual Strings. Check below resources out to know more.
4.1 What are String Buffer & String Builder in Java?
check these resources for more info: https://www.geeksforgeeks.org/string-vs-stringbuilder-vs-stringbuffer-in-java/
Well, I’ve also mentioned a resource down below for you check out some methods Java provides for String Manipulation but its okay if you don’t know what methods mean its okay we’ll cover that in upcoming sections till then check the below resource and see you in next section.
4.2 Some Inbuilt String Methods: https://www.w3schools.com/java/java_ref_string.asp
Day-5: Taking Input in Java
5.1 Scanner Class:
5.2 Using command line argument:
Day-6 : Coding Time!
Well, You’ve been through a lot as now! So its time to check the skills you’ve acquired as of now! Go check you’re progressing.
You’ll find these problems too easy to do for you but it is okay if you’re not able to them just check the editorial of the site to get the answer. See you ahead!
Day-7: Arrays & ArrayList in Java
7.1 What is an Array?
An array is a container object that holds a fixed number of values of a single type. The length of an array is established when the array is created. After creation, its length is fixed. You have seen an example of arrays already, in the main method of the “Hello World!” application.
Types of arrays in Java:
Refer to these sites for learning more!
Check your skills by the resources below:
For 2D arrays: https://www.hackerrank.com/challenges/java-2d-array/problem
7.2 What is an ArrayList?
The ArrayList class is a resizable array, which can be found in the java. util package. The difference between a built-in array and an ArrayList in Java, is that the size of an array cannot be modified (if you want to add or remove elements to/from an array, you have to create a new one).
Check this video out!
Refer to this resource for ArrayList: https://www.geeksforgeeks.org/arraylist-in-java/
7.3 Arrays vs ArrayList: https://www.javatpoint.com/difference-between-array-and-arraylist
See ya in the next Section!
Day-8: Learn Java Conditionals
8.1 What are Conditional operators?
8.2 What are conditional Statements(if-else)?
Hope you’ve learnt about the if-else statement in java properly if not check out these resources & practice!
practice your skills here: https://www.hackerrank.com/challenges/java-if-else/problem
8.3 Switch Statement in Java:
Day-9: Control Flow – Loops in Java
9.1 FOR , While & Do LOOP:
9.2 For-Each Loop in Java:
Check out this resource: https://www.programiz.com/java-programming/enhanced-for-loop
Also, something important!
9.3 Continue & Break Keyword:
Check out this to learn more about Continue & break keywords: https://www.w3schools.com/java/java_break.asp
See you ahead!
Day-10: Type casting/conversion in Java
10.1 What is Type Casting/Conversion?
It is nothing but the assignment of one type of data type to another and if the two types are compatible Java does the conversion.
Check out more about types of conversion: https://www.edureka.co/blog/type-casting-in-java/
or check out this video!
Day-11:Methods/Functions in Java
11.1 What are Methods?
A method is a block of code which only runs when it is called. You can pass data, known as parameters, into a method. Methods are used to perform certain actions, and they are also known as functions.
Okay, so that should be clear to you now that functions & methods are same.
Check out these resources for more: https://www.geeksforgeeks.org/methods-in-java/
Day-12:Access Modifiers in Java
12.1 What are access modifiers?
These specify the scope of the class,method,field ,constructor. In Java there are four types of access specifiers namely:
1.)Private 2.)Public 3.)Default 4.)Protected
This seems confusing right? check out the below resources to get a good grasp over these.
or check out the video below!
Check this out in case you’re not familiar with scope: https://www.geeksforgeeks.org/variable-scope-in-java/
See you in the next section!
Day-13:Constructors in Java
13.1 What are Constructors?
Constructor is a block of code that initializes the newly created object. A constructor resembles an instance method in java but it’s not a method as it doesn’t have a return type.You can give a constructor to class if you want to initialize something while instantiating a new object.
Check this out: https://beginnersbook.com/2013/03/constructors-in-java/
or like always! a video,
Day-14:Object oriented programming!
Okay so,we’ve been hyped up about this ever since we’ve started out learning!
14.1 what is OOP(object oriented programming)?
OOP is a way of programming (a paradigm) adopted to demonstrate real world entities with its features (which we’ll discuss!).
Some of the pillars(features) of Object Oriented Programming:
1.) Encapsulation 2.)Abstraction 3.)Inheritance 4.)Polymorphism
Okay its time to learn more!
Check out these videos!
Check out these resources:
We will talk about the other two in the upcoming sections! See you ahead!
Day-15: Inheritance in Java
Before we dive deeper into Inheritance check this out first!
15.1 Super keyword:
15.2 What is Inheritance?
It is the mechanism in java by which one class is allowed to inherit the features(variables and methods) of another class. Easy-peezy right? Well,get this! It is basically one class inheriting the features of another class.
Well, The class from which another class inherits is known as parent class or super class and the class which inherits is known as base class or sub class.
Check it out here: https://www.geeksforgeeks.org/inheritance-in-java/
Day-16: Polymorphism in Java
Well, it is another concept of OOP(object oriented programming) lets learn what it means!
16.1 What is Polymorphism?
Polymorphism means “many forms”, and it occurs when we have many classes that are related to each other by inheritance. We’ve talked about Inheritance previously & we learnt that it lets us inherit features from its parent class here comes polymorphism in play , it uses the inherited methods which are having their own functionality & makes to perform different tasks other than what they were meant to do.
Check these out: https://www.w3schools.com/java/java_polymorphism.asp
We attain Polymorphism in Java by below mechanism:
Day-17: Practice Time!
Well, we’ve learnt a lot about Java as of now be it if-else statements to be it functions & constructors. It seems like we should give a slight pause to learning and check out our skills!
Problems for Inheritance:
problems for abstract class:
Some hard problems for increasing problem solving skills:
Okay after practicing you’ll realize this that you’ve become better than ever! After all this is the key to success in any field!
Note:It is fine if you’re not getting these question at first remember great thing takes time & practice so keep practicing more & never give up!
Note:Also,If you wouldn’t able to get the answers tune to the editorials they will help to sort out your problem.
Day-18:Interface in Java
18.1 What is an Interface?
An interface in Java is a blueprint of a class. It has static constants and abstract methods.It is basically a mechanism to achieve abstraction in Java which I guess you must be knowing by now. So , to Explore more about it check out the below resources thoroughly.
Well, Now its time for you to do a little practice!
& I’ll see you in the next section!
Day-19:Packages in Java
Before learning about packages let’s learn about something called import.
19.1 What is this import keyword?
Well,It is use to import packages in Java to use their functionality in our current class.We can import both user-defined & Inbuilt packages with import keyword.
Methods of Importing in Java: https://www.programiz.com/java-programming/packages-import
19.2 What are Packages?
Packages are the method of implementing encapsulation in Java by grouping different classes,interfaces other packages together.At first it sounds confusing well, I understand but once you’ll learn about this you’ll be amazed.
Check These out:
Some Inbuilt Packages that we use to enhance functionality in our program:
some of them are: java,lang,util,awt,io,swing,javax and many more.
Never mind, See you in the next section!
Day-20:Exception Handling in Java
20.1 What is an Exception?
An Exception is basically an unwanted & unexpected event which disrupts the normal flow of the program.These usually occur at runtime because the disrupting events detected at compile time are know as Errors which are some serious issues because of which our program ceases to work.For Example:- When you try to divide something by zero that’s an Exception while if you declare a variable with keyword(like int for; etc.) that’s an Error.
Read more about them here: https://www.geeksforgeeks.org/exceptions-in-java/
How we handle them: https://www.geeksforgeeks.org/flow-control-in-try-catch-finally-in-java/
Types of Exceptions in Java: https://www.geeksforgeeks.org/types-of-exception-in-java-with-examples/
Also, What are Checked & unchecked Exceptions in Java: http://geeksforgeeks.org/checked-vs-unchecked-exceptions-in-java/
Throws keyword in Java: https://www.programiz.com/java-programming/throw-throws
20.2 What are Custom Exceptions in Java?
Well, in a nutshell all I can say is that you can create your own exceptions in Java.Check this out: https://www.geeksforgeeks.org/g-fact-32-user-defined-custom-exception-in-java/
Whoa..That was a difficult topic wasn’t that!? Well I hope you’ve learnt all the things thoroughly. Well, to test that solve some challenges to get better in this topic.
Practice efficiently & I’ll see you in the next Section.
Day-21: File Handling in Java
21.1 What is File Handling?
It is the reading & writing data into a file.In order to perform such functionalities we use Java.io package which helps us to read & write data to a file.
Read more here: https://www.javatpoint.com/java-io
what is a stream? : https://www.edureka.co/blog/file-handling-in-java/#WhatisaStream?
Write data to a file: https://www.javatpoint.com/java-io
Read data from a file: https://www.javatpoint.com/java-fileinputstream-class
What is Buffered reader? :https://www.edureka.co/blog/bufferedreader-in-java/#reader
Check this out too : https://www.geeksforgeeks.org/file-handling-java-using-filewriter-filereader/
Day-22: Enumeration in Java
What is Enumeration?
An Enumeration is a complete, ordered listing of all the items in a collection. The term is commonly used in mathematics and computer science to refer to a listing of all of the elements of a set.(source:https://en.wikipedia.org/wiki/Enumeration).
Well,check out more here: https://www.geeksforgeeks.org/enum-in-java/
Day-23: Practice Time
If you’ve made this far! Trust me you are going to be a brilliant developer because the challenges that have been bestowed upon you wasn’t some piece of cake but however because of your hard work,persistence & determination you’ll see that now it was just some piece of cake 😊.But however this doen’t mean you should stop! instead its time to develop some hardcore problem solving skills!
Solve the problems from the below resources:
Try these pattern Matching exercises too! https://www.edureka.co/blog/30-pattern-programs-in-java/
Those were a hell lotta problems but I believe that by now with much of practice you should be able to solve these but again it is okay if you wouldn’t able to solve any of those, you can anytime look into the editorials but most importantly never feel bad if you weren’t able to solve any of those its completely fine because learning & becoming pro efficient is a long process so keep going!
Okay young Jedi! I see you in the next section! 😃
Some Miscellaneous Stuff
Day-24: Data Structures in Java
Well, We have come a long way in our path to learning Java & becoming a pro Java dev but its time equip ourselves with the tools which every developer use to solve every problems they face known as Data Structures.These are the basic fundamentals of Computer Science & they come a lot in handy.So First visit this article ( http://edureka.co/blog/data-structures-algorithms-in-java/ ) & then we’ll talk about some inbuilt Data Structures in Java.
Previously,We’ve Talked about Arrays which are the fundamental data structure found in almost every language & we’ve also talked about ArrayList & how they are different from arrays. Okay its time to talk about some more.
These are some of the inbuilt data structures which could be of help to you.
See you in the next section!
Day-25:Threading in Java
25.1 What is a Thread?
A Thread is a Thread of execution in a program. The Java Virtual Machine allows an application to have multiple Threads of execution running concurrently.Threads allows a program to operate more efficiently by doing multiple things at the same time.Threads can be used to perform complicated tasks in the background without interrupting the main program.Threading is basically used to perform multiple tasks at the same time. cool! right? Well,there’s a term related to multiple processes at the same time & that is know as Multi-Threading.
Learn More here: https://www.w3schools.com/java/java_threads.asp
What is Java Virtual Machine(JVM)? https://en.wikipedia.org/wiki/Java_virtual_machine
Day-26: Wrapper class in Java
26.1 what is Wrapper class?
It is used to convert primitive data-types into objects.It is another mechanism based upon the OOP concept encapsulation.
Read more here: https://www.geeksforgeeks.org/wrapper-classes-java/
26.2 What is autoboxing?
Day-27 Inner Class in Java
What is an Inner classes?
Well, Just like a Nested Method we also can nest classes i.e put one class inside other and the class that is nested(inside another class) is known as Inner class.
Read more here: https://www.geeksforgeeks.org/inner-class-java/
Projects using Java
Day-28: Banking project
Well, Its time to test our equipped knowledge into the most fun part of this plan which is project development. Who doesn’t love it & after all this is what we the developers do i.e Develop cool stuff! So its time for you to Work on this project.It is going to be a simple program but you will learn a lot by this. So, Let’s Do this!
Day-29: Tic-Tac-Toe Project
Its time for you to work on this cool project.Let’s do this too!
Day-30: Quiz time!
Okay! so, you have made this far! Alright I should call a Java Dev now! Never mind take this last quiz just to ensure your skills.
Note:There’ll be lots of quizes once you follow this link, try to solve each quiz present there.
You can also check W3School’s quiz : https://www.w3schools.com/java/java_quiz.asp
If you’ve completed the quiz with high scores, Congratulations you are a pro Java Dev now! 😊
You Did it! 👏
Since, you are a Pro Java Dev now, Its time for you to move into more complex fields like App development, Web Development, Application Development (like backend services, etc.) whichever interests you.
Check this article out: https://www.quora.com/What-can-Java-programming-do
I have provided some of the resources below for you to get started into fields like App development & Java application development.
Check them out!
Note: We use Android studio(separate IDE) for App development & for Java application development you should check out this spring framework in Java(video below). I have provided some of the resources below be sure to check them out.
Note: I have listed some of the things you can do as a Java Dev again you can always find out things that interests you as there is a lot of variety available out there.
You can also Check Graphical User Interface(GUI) Development in Java!
Well, Now this is some fun thing you can do with Java. You can create your own desktop applications with Java using the Awt & Swing framework in Java. Well, we don’t use Awt anymore because of the latest features being Incorporated in the Swing framework.
Well,You can make your own GUI easily by using any IDEs like ecllipse or Netbeans. I’ve listed a video below for you too follow but if you want to dig deeper into it and learn even the basics of the GUI development(Swing framework) its features likes frames,eventlisteners, window class & much more it’ll be a lengthy process but it is recommended as it will help you to figure out things more easily i.e how it works. you can follow the guide: https://www.javatpoint.com/java-swing
or the below videos!
You can also follow this course!