Logo video2dn
  • Сохранить видео с ютуба
  • Категории
    • Музыка
    • Кино и Анимация
    • Автомобили
    • Животные
    • Спорт
    • Путешествия
    • Игры
    • Люди и Блоги
    • Юмор
    • Развлечения
    • Новости и Политика
    • Howto и Стиль
    • Diy своими руками
    • Образование
    • Наука и Технологии
    • Некоммерческие Организации
  • О сайте

Скачать или смотреть static import in Java Complete explanation

  • Learn Java
  • 2024-04-17
  • 129
static import in Java Complete explanation
#shorts#javaShorts#balaji m#java#computers#JavaInterviewQuestions@Learn Java#coding#programming#developer#programmer#code#codinglife#coder#software#technology#ilovecoding#softwareengineer#devlife#softwareengineering#development#geek#geeklife#programmerlife#programminglife#codingisfun#nerd#coderlife#codingfun#compassion#passionate#html#python#webdesign#php#javascript
  • ok logo

Скачать static import in Java Complete explanation бесплатно в качестве 4к (2к / 1080p)

У нас вы можете скачать бесплатно static import in Java Complete explanation или посмотреть видео с ютуба в максимальном доступном качестве.

Для скачивания выберите вариант из формы ниже:

  • Информация по загрузке:

Cкачать музыку static import in Java Complete explanation бесплатно в формате MP3:

Если иконки загрузки не отобразились, ПОЖАЛУЙСТА, НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если у вас возникли трудности с загрузкой, пожалуйста, свяжитесь с нами по контактам, указанным в нижней части страницы.
Спасибо за использование сервиса video2dn.com

Описание к видео static import in Java Complete explanation

You can learn Java with me as the Java Programming language is being made easily. It would take a period of minimum three months and maximum 6 months to master Java. I would recommend you to watch all my videos to crack any software interviews that would require Java Programming language as a primary skill.

static import:-
===========
Please be informed that the concept of static import in java is introduced in java 5 version.

You can use static import, if you want to access any static member of any class directly. And, you don't have to call it by using the class name or Object reference. And, in addition, less coding is required if you have access any static members of any class very often.

Syntax:-
=====
import static packagename.ClassName.*;--Here '*' represents all the static members of the specific class

Example:-
=========
import static abc.A.*;

Here abc is the package name and A is the name of the class

What are static members?

All the entities with the static keyword is called as static members.

static members--static variables, static blocks, static methods

How to utilize the class in a different package?

There are 2 ways to get access to a class which is placed in a different package by ensuring that the class is a public class.

1. You can use direct import keyword to import the respective package in which the required class is placed.

Example:-
========

import abc.A;

2.Fully Qualified name needs to be used.

Example:-

packageName.className

Predefined Class in a predefined Package:-
=========================================

Thread Class is one of the predefined class which has many static members as follows.

predefined class:-
==================
public class Thread{
//Instructions
public static final int MIN_PRIORITY=1;
public static final int NORM_PRIORITY=5;
public static final int MAX_PRIORITY=10;

}

predefined package:-
=====================

java.lang.*; predefined package

The above package is one of the predefined package which is available to is by default and in order to get access only to the static memebers we have to use the static import as follows.

Example:-

package abc;//user defined
public class A//User Defined
{
public static int i=100;//static variable
public static void method2()
{
System.out.println(" A");
}
public void method1()
{
System.out.println("B");
}
}

package xyz;

import static java.lang.Thread.*;
public class Test
{
public static void main(String[] args)
{

System.out.println(MIN_PRIORITY);//1
System.out.println(NORM_PRIORITY);//5
System.out.println(MAX_PRIORITY);//10
}
}


Difference between import and static import?

The import allows the programmer to access all the classes of the package without package qualification whereas the static import feature allows to access the static members of a class without the class qualification.

The import keyword provides accessibility to classes and the static import provides accessibility to the static member of the classes.

Комментарии

Информация по комментариям в разработке

Похожие видео

  • О нас
  • Контакты
  • Отказ от ответственности - Disclaimer
  • Условия использования сайта - TOS
  • Политика конфиденциальности

video2dn Copyright © 2023 - 2025

Контакты для правообладателей [email protected]