Java interview

  • OOP
  • Inheritance
  • Encapsulation
  • Polymorphism
  • Abstraction
  • Constructor
  • Object
  • Interface и class
  • Access modifiers such as private, default, protected and public
  • Abstract class and method
  • Exception and Error

OOP

OOPs in Java organizes a program around the various objects and well-defined interfaces. The OOPs Concepts in Java are abstraction, encapsulation, inheritance, and polymorphism

Inheritance

- it is possible to inherit attributes and methods from one class to another
- is a mechanism in which one object acquires all the properties and behaviors of a parent object
- Java does not support Multiple inheritance

Encapsulation

- By encapsulating a class's variables, other classes cannot access them, and only the methods of the class can access them
- hiding the implementation of the class and separating its internal representation from the external class or interface

Polymorphism

- is the ability to apply the same methods with the same or different sets of parameters in the same class or in a group of classes connected by an inheritance relation
-

Abstraction

- is the process of hiding implementation details from the user, giving the user only the functionality
- the user will own the information about what the object does, not how it does it

Constructor

- All classes have constructors, whether you define them or not, because Java automatically provides a default constructor
- The constructor is a method that creates a kind of "framework" for the class. Every new object of the class must conform to it

Object

- is an individual member of a class that has a particular state and behavior that is completely determined by the class
- Variables are used to store the state of the object
- The object is an instance of the class
- Any object can have two main characteristics: state - some data that the object stores, and behavior - actions that the object can perform

Class

- A class is a template structure that allows you to describe an object, its properties (class attributes or fields) and behavior (class methods) in a program
- Class can consist methods, objects and constructors. Class is a template of an object, he has a body with fields and methods 

Interface

- An interface is a reference type, it is similar to a class. It is a collection of abstract methods. 
- A class implements an interface, thus inherits the abstract methods of the interface
- There is no implementation inside the interface
The interface only describes the behavior of some object
- Only immutable final fields can be in the interface

Abstract class and method

- Abstract class describes some general state and behavior that future classes - descendants of the abstract class - will have.
- Similar to interfaces, abstract classes can have abstract methods, an abstract method is a method without a body (without implementation), but unlike interfaces, abstract methods in abstract classes must be explicitly declared as abstract.

Access modifiers

- public, protected, default, and private.
- Protected - declarations are visible within the package or all subclasses
- Default - declarations are visible only within the package (package private)

This

- Keyword this is a link to the current class instance, we can use this word to call constructors, variables and object method’s 

Static

- Static methods and variables are related to the class
- Static methods belong to a class, not an object. You can call them without creating an instance of the class
- From a static method you can access only static variables or methods

Как создать американский эпл айди ?

Используя американский apple ID или аккаунт вы получаете доступ к магазину эпл стор в США, в котором представлены игры или приложения отличающиеся от европейских (например, покемон го).

  1. Вам необходимо создать новую почту, желательно на почтовом сервисе гугла http://www.gmail.com
  2. Зайти в app store магазин с приложениями и выйти из текущего аккаунта

    APP STORE
    APP STORE
  3. Зайти в настройки айфона – основные – язык и регион и поставить там United States

    REGION
    REGION United States
  4. Далее необходимо вернуться в магазин приложений эпл стор и скачать любое бесплатное приложение, например,  youtube
  5. При скачивании приложения айфон предложит залогиниться или создать новый аккаунт. Создаем новый apple id

    United States
    United States
  6. Заполняем данные, вместо кредитной карточки выбираем none, место проживания можете использовать любой отель в любом штате: IMG_6786 Address
  7. На почту вам придет подтверждение регистрации. Необходимо пройти по ссылке, и у вас появится новый Apple ID привязанный к американскому App Store.

См. также howis.ru/как-установить-игру-pokemon-go-на-айфон/

Как читать книги на айфоне и айпаде во встроенном приложении iBooks?

Приложение iBooks установлено по умолчанию на всех эпл устройствах — мак, айфон, айпад.  В приложении есть встроенный магазин книг, где можно купить обычные книги и аудиокниги.

IMG_6821

IMG_6820

Удобство программы заключается в том, что с помощью iBooks также можно открывать файлы .pdf  и читать их как книги.

Основной формат книг — .ePub, в котором удобно читать, можно менять размер букв, ставить закладки, есть оглавление.

Книги можно покупать во встроенном магазине, либо находить в интернете и закачивать в программу следующим образом:

Для файлов .pdf

  1. Отправить письмо с вложением .pdf себе на почту, установленную на айфоне/айпаде.
  2. Нажать на вложение, далее нажать на значок поделиться и скопировать в iBooksIMG_6822

Для файлов .ePub

  1. Находите в интернете необходимую книгу
  2. Открываете ссылку с айфона/айпада
  3. При открытии вам предложат открыть с помощью приложения iBooks

Как скачать все фото из айфона на компьютер Mac?

Когда возникает необходимость быстро импортировать все фото и видео с айфона на компьютер, с этим могут возникнуть некоторые сложности.

Способ 1

  1. Подключить айфон к компьютеру используя кабель.
  2. Открыть программу «Фото» или Photos, далее перейти во вкладку Импорт.Screen Shot 2016-07-26 at 14.39.36
  3. Выделить все фотографии или нажать импортировать все фото.Screen Shot 2016-07-26 at 14.19.35
  4. После импорта можно простым перетаскиванием скопировать нужное вам фото, например, на рабочий стол.

Но бывает этот способ не всегда помогает скопировать все фото целиком.

Способ 2

 

  1. Если у вас подключена синхронизация с облаком iCloud, то простой вариант будет скачать все фото напрямую оттуда.
  2. Необходимо залогиниться под своим Apple id на сайте https://www.icloud.com .Screen Shot 2016-07-26 at 14.24.29
  3. Далее зайти в раздел фото, нажать кнопку выбрать фото, далее выбрать необходимые фотографии и нажать загрузить.Screen Shot 2016-07-26 at 14.29.23
  4. Если нужно разом скачать все фото, то действуем так: нажимаем выбрать фото, выделяем первое фото, далее держа клавишу shift на компьютере выбираем последнее фото и загрузить.

Как установить игру Pokemon GO на айфон ?

Для установки игры необходимо завести отдельный аккаунт в магазине приложений App store в регионе United States.

  1. Создать почту, лучше всего gmail, так аккаунт гугла понадобится далее для входа в саму игру.
  2. Зайти в app store магазин с приложениями и выйти из текущего аккаунта

    APP STORE
    APP STORE
  3. Зайти в настройки айфона – основные – язык и регион и поставить там United States

    REGION
    REGION
  4. Зайти в App Store и найти там Pokemon Go, при скачивании айфон предложит залогиниться или создать новый аккаунт.

    POKEMON GO
    POKEMON GO
  5. Заполнить регистрационные данные

    United States
    United StatesIMG_6786

    Address
    Address
  6. Необходимо проверить почту и верифицировать аккаунт перед скачиванием игры.