Java - JDBC Connection Example-1.
JAVA INSTALLATION ON MAC
- Download the Java from Oracle official site.
- You can download from here : Oracle Site
- Double click on the file that is downloaded to launch it.
- Double click on the package icon to launch install Wizard.
- Click Next and Finish.
Basic Enum EXAMPLE
An enum type is a special data type that enables for a variable to be a set of predefined constants and the names of an enum type's fields are in uppercase letters.
In the Java programming language, you define an enum type by using the enum keyword.
Project Structure
OrderStatus.java
Test.java
OUTPUT
Download SourceCode From Github
ClickToDownloadHow to change Maven resources folder location ?
Maven resources folder contains all your project related xml files , images , text files.
If you want to change the default location from "yourproject/src/main/resources" to your required one or you want to add a new resource folder as per your project needs.
Follow below steps.
Go to your project pom.xml file and search for resources tag and add the new resource folder location with resource tag as below.
For example :Hope this is helpful..........!!!!Thank You.<!-- POM File --> <resources> <----------Old resource folder-----------------!> <resource> <directory>src/main/resources</directory> </resource> <----------New resource folder-----------------!> <resource> <directory>src/main/Yourrequiredfoldername</directory> </resource> <-----------------------------------------------!> </resources>
How to Search Maven Coordinates or Dependecy details-POM.XML
If you want to add a dependency in your maven project , you should know the dependency details to add in POM.XML file of your project.
Then here where we will get stuck usually . We just know which jar or dependency is required that to be added , but we don't know the dependency details.
For any dependency to be added in your POM.XML file we should following three values.
- GroupId (Package name)
- ArtifactId (Dependency name)
- Version (Dependency Version)
You can know the above details by visiting maven central repository site.
Click here : Search in Maven Central RepositoryJust type your dependency name , you will get a list of related dependencies with different versions.
You can see the GroupId , Artifact Id and version details .
Click on your required thing and download it and add dependency details in your POM.XML
For example : For log4j :<!-- Log4j details --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>2.8.2</version> </dependency>Search results for log4j in central repository.
Click on version to more details as below.
In similar way search any dependency you needed in central repository and add in your pom.xml . maven will download it and will keep it in your local repository.
Hope this is helpful..........!!!!Thank You.JAVA CODE SNIPPET-7
/** * */ package techyield; /** * @author satyanarayana gokavarapu * */ public class Super { void init( long a,long b) { System.out.println("Super class long,long method."); } void init( Long a,Long b) { System.out.println("Super class Long,Long method."); } }
package techyield; /** * @author satyanarayana gokavarapu * */ public class Test extends Super{ public static void main(String[] args) { // TODO Auto-generated method stub Super object = new Test(); object.init(2,3); } void init( int a,int b) { System.out.println("Test class int,int method."); } void init(int... a) { System.out.println("Test class varargs method."); } void init( long a,long b) { System.out.println("Test class long,long method."); } }
Select an answer
Please comment below if you have any doubts.
Featured Post
H1B Visa Stamping at US Consulate
H1B Visa Stamping at US Consulate If you are outside of the US, you need to apply for US Visa at a US Consulate or a US Embassy and get H1...
-
Ques 1 : Which declaration of the main method below would allow a class to be started as a standalone program. (A) public static int main(c...
-
1. Two Sum Two Sum Solution 2. LRU Cache LRU Cache Solution 3. Number Of Islands 4. Longest Palindromic Substring 5. Lowest...
-
basics Linux fundamentals like system calls , strace , linux mange memory, shared memory, kernel using, boot process, DNS resolving ( how t...