-
Static
The static variable can be used to refer to the common property of all objects (which is not unique for each object), for example, the company name of employees, college name of students, etc. The static variable gets memory only once in the class area at the time of class loading.
class JavaKA
{
static String course=”java”;
void notes()
{
System.out.println(course);
}
String computer()
{
String course =”html”;
System.out.println(course);
return course;}
public static void main(String args[]){
JavaKA m=new JavaKA();
m.notes();
m.computer();
//System.out.println(course);
}
}Why we should learn static ?
The most important reason why static keywords are heavily used in Java is to efficiently manage memory
Without creating object, we can directly call from the class name
-
Control Statement:
Today we learnt about control statement. The control statements are if else using this we did a program
my program is:
class sasi{
public static void main(String args[]){
int x=10;
int y=5;
if(x>y)
{
System.out.println(“true”);
}
else
{
System.out.println(“false”);
}
}
}Java compiler executes the code from top to bottom. The statements in the code are executed according to the order in which they appear. However, Java provides statements that can be used to control the flow of Java code. Such statements are called control flow statements. It is one of the fundamental features of Java, which provides a smooth flow of program.
If statement:
The Java if statement is the most simple decision-making statement. It is used to decide whether a certain statement or block of statements will be executed or not i.e if a certain condition is true then a block of statement is executed otherwise not.
else statement:
The ELSE statement specifies that alternate processing is to take place when the conditions of the matching IF statement are not satisfied. ELSE. The ELSE statement has no parameters. The ELSE statement must be column-aligned with the matching IF statement.
-
Parameter(Final):
Today class is about final parameters. final parameter defines if we to keep the things constant ,then final parameter will be used.
We got lots of doubt in it. Sir make as out of clarification.
You can pass final variables as the parameters to methods in Java. A final variable can be explicitly initialized only once. A reference variable declared final can never be reassigned to refer to a different object. However, the data within the object can be changed.So, the state of the object can be changed but not the reference. With variables, the final modifier often is used with static to make the constant a class variable.
public class Test{ public void sample(final int data){ System.out.println(data); } public static void main(String args[]) throws Exception{ Test t = new Test(); t.sample(500); } } -
My java love story
Today we leaning to create a program in two ways . I got lots of error but I finally compile my program.
after a lots of struggle I got my output.
Sir gave us homework and the program is


-
Programs using datatypes
Today due to my personal issues I can able to attend my class. Even thought with help of my friends I got to what was thought today.
Today class is about using datatypes how the programs are been excecuted. Datatypes are int, float, char, long, boolean , string etc. using this I excecute a program today.
firstly int defines number.
float defines decimals
char defines single letter(s)
long defines long number.
string defines words.
Using all this I did a program.
class write{
public static void main(String args[])
{
int a=2;
float b=0.9f;
string c=sobhika;
long d=20000000l;
char e=’d’;
System.out.println(a+” “+b+” “+c+” “+d+” “+e+” “)
}
}
-
A cute program
finally after a one week one our class we today we entered into program . We did program in mint and that was very interesting. I personally did 5 mistakes and I corrected it.
Firstly, I put my program in text editor and I run it in terminal. My first mistake was a syntax error. And capital letter error. Once I corrected all my error I just figure it our.
I got with the doubt that what purpose we are using all this syntax . My trainer Arun sir explained it . And finally I got to why we use those.
And here is my cute program:
class helloworld{
public static void main(String args[])
{
System.out.print(“helloworld”)
}
}
-
My missing class
Today I miss my java class due to I got sick. But my friends thought me my missed class. Two of my friends helped me. Today class was full of Data Types Data Type consist of int, byte, long, double, float, short, string, char, boolean
Also we thought with binary and decimal number. I have doubt on that topic but friends figure it out.
Type Name Bytes Other Names Range of Values int4 signed-2,147,483,648 to 2,147,483,647 unsigned int4 unsigned0 to 4,294,967,295 __int81 char-128 to 127 unsigned __int81 unsigned char0 to 255 __int162 short,short int,signed short int-32,768 to 32,767 unsigned __int162 unsigned short,unsigned short int0 to 65,535 __int324 signed,signed int,int-2,147,483,648 to 2,147,483,647 unsigned __int324 unsigned,unsigned int0 to 4,294,967,295 __int648 long long,signed long long-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 unsigned __int648 unsigned long long0 to 18,446,744,073,709,551,615 bool1 none falseortruechar1 none -128 to 127 by default
0 to 255 when compiled by using/Jsigned char1 none -128 to 127 unsigned char1 none 0 to 255 short2 short int,signed short int-32,768 to 32,767 unsigned short2 unsigned short int0 to 65,535 long4 long int,signed long int-2,147,483,648 to 2,147,483,647 unsigned long4 unsigned long int0 to 4,294,967,295 long long8 none (but equivalent to __int64)-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 unsigned long long8 none (but equivalent to unsigned __int64)0 to 18,446,744,073,709,551,615 enumvaries none float4 none 3.4E +/- 38 (7 digits) double8 none 1.7E +/- 308 (15 digits) long doublesame as doublenone Same as doublewchar_t2 __wchar_t0 to 65,535 -
Linux installation
Today I installed linux. The experience was terribly bad I literally suffered lots. Unfortunately my system was very slow. Me and one my friends tried hard for the installation.
somedays we keep on trying for the good result and once we get it so, will be very happy . I actually felt the same while installing linux on my computer
-
My First day in Payilagam exprience
Hi this is sobhika , in my first day in payilagam I came to that my upcoming days in payilagam will be good and more unerstanding with my new friends. The motivation of Muthu sir inspires us really. That first day was very fun and enjoyable . We played game and we relaxed aswell, the best part of the day was, we sharing lots of infomation about our collage days. Will hope the best will come to us in upcoming months
-
Hello World!
Welcome to WordPress! This is your first post. Edit or delete it to take the first step in your blogging journey.