βπ»βπ»......πππ......βπ»βπ»
Java Access Spacifier
--------------------------------------
1) Private :- members [method and variable] are only used in same class.
2) default :- if you not write any access specifier then it is consider default. Default members are accessible only with in same package
3) protected :- veritable, methods, and contractor, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class with in the package of the protected members class
4) public :- A class, method, contractor, interface, etc. declared public can be accessed from any other class. Therefore fields, methods, blocks declared in side a public class can be accessed from any class belonging to java Universe.
Join us @Compu
Java Access Spacifier
--------------------------------------
1) Private :- members [method and variable] are only used in same class.
2) default :- if you not write any access specifier then it is consider default. Default members are accessible only with in same package
3) protected :- veritable, methods, and contractor, which are declared protected in a superclass can be accessed only by the subclasses in other package or any class with in the package of the protected members class
4) public :- A class, method, contractor, interface, etc. declared public can be accessed from any other class. Therefore fields, methods, blocks declared in side a public class can be accessed from any class belonging to java Universe.
Join us @Compu
βπ»βπ»......πππ......βπ»βπ»
Java
Why to use import?
To use classes of other packages
@Compu
Java
Why to use import?
To use classes of other packages
@Compu
βπ»βπ»...... πππ..... βπ»βπ»
Q:- What is class?
Ans:- Collection of variable and methods.
Q:- Why to create object?
Ans:- to call members of some other class.
Q:- why to write method?
Ans:- To perform any
Q:- why to use veriable?
Ans:- To store a data.
@Compu
Q:- What is class?
Ans:- Collection of variable and methods.
Q:- Why to create object?
Ans:- to call members of some other class.
Q:- why to write method?
Ans:- To perform any
Q:- why to use veriable?
Ans:- To store a data.
@Compu
βπ»βπ»......πππ......βπ»βπ»
Q :- What is Constructor? (In JAVA)
Answer: A constructor is a special method whose task is to initialize the object of its class.
It is special because its name is the same as the class name.
They do not have return types, not even void and therefore they cannot return values.
They cannot be inherited, though a derived class can call the base class constructor.
Constructor is invoked whenever an object of its associated class is created.
@Compu
Q :- What is Constructor? (In JAVA)
Answer: A constructor is a special method whose task is to initialize the object of its class.
It is special because its name is the same as the class name.
They do not have return types, not even void and therefore they cannot return values.
They cannot be inherited, though a derived class can call the base class constructor.
Constructor is invoked whenever an object of its associated class is created.
@Compu
βπ»βπ»......πππ......βπ»βπ»
IN JAVA
> Importing all classes on lang package.
>> In java every class is subclass of object class [in java Object is inbuilt class]
>>> In every constructor at first line automatically super() will be added.
@Compu
IN JAVA
> Importing all classes on lang package.
>> In java every class is subclass of object class [in java Object is inbuilt class]
>>> In every constructor at first line automatically super() will be added.
@Compu
Q:- Find the output of the following code.
int ++a = 100; System.out.println(++a);
int ++a = 100; System.out.println(++a);
Anonymous Quiz
26%
101
49%
Compile error as ++a is not valid identifier
22%
100
3%
None
βπ»βπ»......πππ......βπ»βπ»
Q:- Find the output of the following code.
Public class Solution{ Public static void main(String⦠argos){ Int x = 5; X * = 3 + 7; System.out.println(x);
Q:- Find the output of the following code.
Public class Solution{ Public static void main(String⦠argos){ Int x = 5; X * = 3 + 7; System.out.println(x);
Anonymous Quiz
27%
50
33%
22
27%
10
12%
None
βπ»βπ»......πππ......βπ»βπ»
Q.Β Identify the return type of a method that does not return any value.
Q.Β Identify the return type of a method that does not return any value.
Anonymous Quiz
17%
Int
53%
void
23%
double
6%
None
βπ»βπ»......πππ......βπ»βπ»
In JAVA
>Serialization : writing of object state into any external source [file, cloud] is called as serialization.
>DeSeralization : reading of data from external source [file, cloud] and converting that into object is called as deserailization.
>This concept is used in sending data in distributed system.
@Compu
In JAVA
>Serialization : writing of object state into any external source [file, cloud] is called as serialization.
>DeSeralization : reading of data from external source [file, cloud] and converting that into object is called as deserailization.
>This concept is used in sending data in distributed system.
@Compu
βπ»βπ»......πππ......βπ»βπ»
Q: Where does the system stores parameters and local variables whenever a method is invoked?
Q: Where does the system stores parameters and local variables whenever a method is invoked?
Anonymous Quiz
15%
Heap
42%
Stack
36%
Array
7%
Tree