filmov
tv
#53 Packages in Java
Показать описание
Check out our courses:
Coupon: TELUSKO10 (10% Discount)
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
For More Queries WhatsApp or Call on : +919008963671
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
-- 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.
-- 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
and db package has two files
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.
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
-- 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
More Learning :
Donation:
PayPal Id : navinreddy20
Coupon: TELUSKO10 (10% Discount)
Coupon: TELUSKO20 (20% Discount)
Udemy Courses:
For More Queries WhatsApp or Call on : +919008963671
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
-- 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.
-- 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
and db package has two files
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.
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
-- 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
More Learning :
Donation:
PayPal Id : navinreddy20
Комментарии