Navigate Select ESC Close

#53 Packages in Java

2023-01-19 Science & Technology
391.3k
6.6k
100
Telusko
Telusko
2.8m subscribers

Unlock all features

FREE: Get instant access to 10 AI summaries, chats, or transcripts per day.

Description

Check out our courses: Industry-Ready Java Spring Boot, React & Gen AI -Live: https://go.telusko.com/industry-ready-course Coupon: TELUSKO10 (10% Discount) AI-Powered DevOps with AWS- Live V3: https://go.telusko.com/ai-powered-devops-with-AWS-v3 Coupon: TELUSKO10 (10% Discount) Master Java Spring Development : https://go.telusko.com/masterjava Coupon: TELUSKO20 (20% Discount) For More Queries WhatsApp or Call on : +919008963671 website : https://courses.telusko.com/ Java Spring:- https://go.telusko.com/Udemyjavaspring Java:- https://go.telusko.com/udemyteluskojava Spring: https://go.telusko.com/udemyteluskospring Java For Programmers:- https://go.telusko.com/javaProgrammers Python : https://go.telusko.com/udemyteluskopython Git : https://go.telusko.com/udemyteluskogit Docker : https://go.telusko.com/udemyteluskodocker Instagram : https://www.instagram.com/navinreddyofficial/ Linkedin : https://in.linkedin.com/in/navinreddy20 WhatsApp : https://go.telusko.com/whatsapp TELUSKO Android App : https://go.telusko.com/TELUSKOAPP TELUSKO IOS App : https://apple.co/3SsgmU2 Discord : https://discord.gg/D8hWe9BqfF In this lecture we are talking about package: -- what is package ? -- you are using music, documents, video and you need to store in a different folder as per their use to avoid confusion (Similarly in java for storing class, enum , annotations, sub package we are using concept of package). -- in song folder you have multiple songs folder e.g sad songs, romantic songs, rocking song for that we can create sub folders inside folders of songs ,in package also we can create package inside package (Syntax java.util here java is package and util is subpackage). -- you can structure in which we put similar types of codes in one folder, this concept in java is known as package. -- for creating a package we can use a keyword called package at a top of code and code file is in that package. -- suppose we have AdvCalc.java and Calc.java in one folder tools then then we can say that AdvCalc.java and Calc.java in tools package. -- if we create database code then you can write it in separate package i.e db package -- if two java file in different package then you need to import class of one package to different package. suppose that tools package has two files a)AdvCal.java b)Calc.java and db package has two files a)Demo.java b)Multiply.java suppose in Demo.java we want to use AdvCal object for that we need to import AdvCal class from tools package package db; //Demo in db folder so that we need to mention import tools.AdvCal; // without importing we can get error in creating object class Demo{ public static void main(String []args){ AdvCal obj =new AdvCal(); } } -- there are many package provided by oracle. e.g import java.util.ArrayList -- it means we are importing ArrayList class from java.util package here java is main package and util is sub package inside main package and from this we can import ArrayList class. java is package and util is subpackage of java then from util package we can import ArrayLis.t -- by default we import java.lang.*; in every java file -- when you create library then you need to create package and package should be unique name. -- go to mvn repository -- one way to building library reversing the domain name -- for google if i making package then com.google Github repo : https://github.com/navinreddy20/Javacode.git More Learning : Java :- https://bit.ly/3x6rr0N Python :- https://bit.ly/3GRc7JX Django :- https://bit.ly/3MmoJK6 JavaScript :- https://bit.ly/3tiAlHo Node JS :- https://bit.ly/3GT4liq Rest Api :-https://bit.ly/3MjhZwt Servlet :- https://bit.ly/3Q7eA7k Spring Framework :- https://bit.ly/3xi7buh Design Patterns in Java :- https://bit.ly/3MocXiq Docker :- https://bit.ly/3xjWzLA Blockchain Tutorial :- https://bit.ly/3NSbOkc Corda Tutorial:- https://bit.ly/3thbUKa Hyperledger Fabric :- https://bit.ly/38RZCRB NoSQL Tutorial :- https://bit.ly/3aJpRuc Mysql Tutorial :- https://bit.ly/3thpr4L Data Structures using Java :- https://bit.ly/3MuJa7S Git Tutorial :- https://bit.ly/3NXyCPu Donation: PayPal Id : navinreddy20 https://www.telusko.com

Top Comments (10)

@pintu_patil 2023-02-26

I get addicted to this man just bcoz of his teaching...the real java man ♂️ amazing way of explanation thank you sir✨

203
@vigneshrebba9560 2023-08-18

this is the type of teaching that every one want .

30
@jayasharma4302 2023-08-16

This entire Telusko Java mix is so useful and along with code snippets we get a real picture. Thanks Navin for giving this to all students and engineers. :)

40
@mihirpawar2126 2024-03-14

This is the type of explanation I needed a lot. Sir hats off to you. Your way of teaching is very simple and effective. Just by listening automatically everything got stored in my mind.

8
@VinitSawant94 2023-12-14

Revising this for my 3rd switch of career 😅

7
@dumbburger9663 2024-11-14

I JUST LITERALLY DONT UNDERSTAND HOW CAN THESE TYPE OF VIDEOS BE FREE TO WATCH. THANKYOUU for making our coding life easier

9
@lesiamakhova769 2023-02-25

Very useful for junior but for seniors also in order to refresh in mind Java basics.

15
@siddharth.chandani 2024-12-29

Man when you explain 9:00 these types of small things with this much detail, that makes you the best from others!! keep doing it. love u

8
@krisinfo7823 2023-11-18

Thank you so much! You are far far far better than the teacher at my college!!

6
@Qadir1207 2026-04-12

A Great Thanks to You Sir You cleared everything about packages ❤❤❤

0

Unlock the Data Inside
Turn Videos into Knowledge

  • Get FREE 10/day: transcripts, summaries, chats
  • Chat with videos, export text & PDF
  • $1 free API credit for RAG, chatbots & research

Free forever plan • All features unlocked

App screenshot