Monday, 14 December 2015

what is public? what is static? what is void? what is main? what is string args[]? what is system.out.println()? in java

                                                           Hiiiiii... am back to tell what is?

ok see the code once again (not the C O D E ):

C O D E:
          package com;
          public class HelloJavaClassName

          {
          public static void main(String []args)

          {
          System.out.println("Hello World");
          }
          }


what is public?

public class HelloJavaClassName

we called this (Public, Private, Protectedaccess modifiers ...and also this is a keyword so we can not use this as variable. I hope you know what is  variables if you are not I do not care ha ha ha...

Public is like Public, a variable or method is public means that can access by any class

Ex:--
                  public int a;

 this is a public variable this variable can access from anywhere form your entire application so we called this as global variable

oK dude! what is 

public class HelloJavaClassName
{

}

This is called class , it can be defined as template it describes the object behaviours
 

ok then what is object ?


Object is an instance of a class it  has its own states and behaviours.

ok yaaarrr now I can understand what is class but inside the class something is there what is that?

public class HelloJavaClassName
{
public static void main(String []args)
{
System.out.println("Hello World");
}

}

This is what we called method,  a class can contain many method  u can c d keyword  main so this is main method. It is always public because it has to be accessed by the runtime.

yaa u can create your own method inside the class ... but listen you method name should start with smaller case (naming conversion).

for example:

public class HelloJavaClassName
{
public void shouldStartWithSmallCase()
}

this is called method name shouldStartWithSmallCase()

What is static?


Static is also keyword, if You use static keyword to the variable that variable value is static to the entire application.

public class HelloJavaClassName
{
static int pi=3.14159265358979323846264338327950288419716939937510582097494459230781640
}

The pi value is, Oh! sorry you can use 3.14 this value never going to change so we can declare this pi variable as static, for your entire program the pi value is 3.14 only this is we called static variable

static variable gets memory once at the time of class loading...


oKeY! why we use public static void main(String []args) ?

This is the main function, any doubt on that if any read from first. Main function should run first , the static keyword trigger the main function for first execution. so every program started to run from main class. That means main class always run first.

what is void ?

This method just print helloworld so we are not going to return any value here, void means that the method has no return value.

what is string args[]?

string and args is keyword ,java takes every values as string so we use the data type string.args[] is argument array of console line values stored in the [] array argument.
I know it is little bit difficult to understand study about array and data type then u can understand little bit more...

what is system.out.println()?

what is class? what is package(check on previous post)? what is method?
 
If you know the answer for the previous questions then you can understand system.out.println
 
System  is a class in the package of  java.lang
 
out  is the instance of java.io.PrintStream
 
println is the methosd of  java.io.PrintStream
 
This will help to print the output......
 
ok session is end today c u sooon...












  

Thursday, 10 December 2015

Java hello world in eclipse

Here, i am going to  discuss about very basic java learning blah blah blah...k lets start the hello wold program in java using eclipse.



Java hello world in eclipse
This is the first step :

Open your eclipse click file -> New -> and select Project


Java hello world in eclipse

Step 2:

select the java project...

Java hello world in eclipse

step 3:

now u can see the window ... just give the project name and click finish


Java create class

step 4:

click your project  name ..Oooops right click your project name and again new -> Class


Java create class and packages

Step 5:

Package: yah that is package , I can see that but what is package?

package is  similar to different folders on your computer ...( i can not explain about  folders and computers if you want to know mail me...) 
you can create packages (folders) to write your class , i gave [] com [] in the package name

Name: it's your class name ...give it and click finish


Java hello world



Step 6:

your package and class created ,now type the code... or copy paste it

package com;
public class HelloJavaClassName {
 public static void main(String []args) {
        System.out.println("Hello World");
     }
}


Now press the play button or press  Ctrl + F11 you can see the result in the console window...



Yah ! you run your first java program but
what is public?
what is static?
what is void? 
what is main?
what is String args and what is []?
what is System.out.println();?

try to search on web else wait for the next post.....  






 








 

Tuesday, 11 August 2015

Login Application in VBA Excel Macro


                                                                  
Hi am karthikeyan k, Software Developer here i post  How to create Login page in vba  with more effective way..

Design  the login page...



coding...



Public Username As String  
Public Password As String  
Public i As Integer  
Public j As Integer  
Public u As String  
Public p As String   
  
Private Sub CommandButton1_Click ()  
    Application.ScreenUpdating = False  
    If Trim (TextBox1.Text) = "" And Trim (TextBox2.Text) = "" Then  
        MsgBox "Enter username and password.", vbOKOnly  
        Else If Trim (TextBox1.Text) = "" Then  
        MsgBox "Enter the username ", vbOKOnly  
        Else If Trim(TextBox2.Text) = "" Then  
        MsgBox "Enter the Password ", vbOKOnly  
    Else  
        Username = Trim (TextBox1.Text)  
        Password = Trim (TextBox2.Text)  
        i = 1  
        Do While Cells (1, 1).Value <> ""  
            j = 1  
            u = Cells (i, j).Value  
            j = j + 1  
            p = Cells (i, j).Value  
            If Username = u And Password = p And Cells (i, 3).Value = "fail" Then  
                MsgBox "Your Account temporarily locked", vbCritical  
                Exit Do  
                Else If Username = u And Password = p Then  
                Call clear  
                UserForm1.Hide  
                UserForm2.Label1.Caption = u  
                UserForm2.Label1.ForeColor = &H8000000D  
                UserForm2.Show  
                Exit Do  
                Else If Username <> u And Password = p Then  
                MsgBox "Username not matched", vbCritical + vbOKCancel  
                Exit Do  
                Else If Username = u And Password <> p Then  
                If Cells (i, 3).Value = "fail" Then  
                    MsgBox "Your account is blocked", vbCritical + vbOKCancel  
                    Exit Do  
                    Else If Cells (i, 4).Value < 2 Then  
                    MsgBox "Invalid password", vbCritical  
                    Cells (i, 4).Value = Cells (i, 4) + 1  
                    Exit Do  
                Else  
                    Cells (i, 4).Value = Cells (i, 4) + 1  
                    Cells (i, 3).Value = "fail"  
                    Cells (i, 2).Interior.ColorIndex = 3  
                    Exit Do  
                End If  
            Else  
                i = i + 1  
            End If  
        Loop  
    End If  
    Application.ScreenUpdating = True  
End Sub  
Sub clear ()  
    TextBox1.Value = ""  
    TextBox2.Value = ""  
End Sub  
Private Sub TextBox1_Enter ()  
    With TextBox1  
        .Back Color = &H8000000E  
        .Fore Color = &H80000001  
        .Border Color = &H8000000D  
    End With   
    TextBox1.Text = ""  
End Sub  
Private Sub TextBox1_AfterUpdate ()  
    If TextBox1.Value = "" Then  
        TextBox1.BorderColor = RGB (255, 102, 0)  
    End If  
    i = 1  
    Do Until Is Empty (Cells (i, 1).Value)  
        If TextBox1.Value = Cells (i, 1).Value Then  
            With TextBox1  
                .Border Color = RGB (186, 214, 150)  
                .Back Color = RGB (216, 241, 211)  
                .Fore Color = RGB (81, 99, 51)  
            End With  
        End If  
        i = i + 1  
    Loop  
End Sub  
Private Sub TextBox2_Enter ()  
    With TextBox2  
        .Back Color = &H8000000E  
        .Fore Color = &H80000001  
        .Border Color = &H8000000D  
    End With  
    TextBox2.Text = ""  
End Sub  
Private Sub TextBox2_AfterUpdate ()  
    i = 1  
    Username = TextBox1.Value  
    Password = TextBox2.Value  
    If TextBox2.Text = "" Then  
        TextBox2.BorderColor = RGB (255, 102, 0)  
    End If  
    Do Until Is Empty (Cells (i, 1).Value)  
        j = 1  
        u = Cells (i, j).Value  
        j = j + 1  
        p = Cells (i, j).Value  
        If Username = u and Password = p Then  
            With TextBox2  
                .Border Color = RGB (186, 214, 150)  
                .Back Color = RGB (216, 241, 211)  
                .Fore Color = RGB (81, 99, 51)  
            End With  
            Exit Do  
            Else If Username = u and Password <> p Then  
            TextBox2.BorderColor = RGB (255, 102, 0)  
            Exit Do  
        Else  
            i = i + 1  
        End If  
    Loop  
End Sub  
Sub settings ()  
    With UserForm1  
        TextBox1.ForeColor = &H8000000C  
        TextBox2.ForeColor = &H8000000C  
        TextBox1.BackColor = &H80000004  
        TextBox2.BackColor = &H80000004  
        TextBox1.Text = "Username"  
        TextBox2.Text = "Password"  
        TextBox1.BorderColor = RGB (0, 191, 255)  
        TextBox2.BorderColor = RGB (0, 191, 255)  
        CommandButton1.SetFocus  
    End With  
End Sub  
Private Sub UserForm_Initialize ()  
    Call settings  
End Sub
  

Excel value...

Thank You....

                                                                                                      -This article is posted by karthikeyan

Thursday, 1 January 2015

131 Basic Networking Questions and Answers download here...

Basic Networking Questions and Answers 9

A network in which there are multiple network links between computers to provide multiple paths for data to travel.
A method for providing fault tolerance by using multiple hard disk drives to get backups of data.
A Management Information Base is part of every SNMP-managed device. Each SNMP agent has the MIB database that contains information about the device's status, its performance, connections, and configuration. The MIB is queried by SNMP.
A layer of a glass surrounding the center fiber of glass inside a fiber-optic cable.
A generic term for section of a large networks usually
A gateway operates at the upper levels of the OSI model and translates information between two completely different network architectures or data formats.
A communications protocol used to connect computers to remote networking services including Internet service providers.
10Base2—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that uses baseband signaling, with a contiguous cable segment length of 100 meters and a maximum of 2 segments
10Base5—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that uses baseband signaling, with 5 continuous segments not exceeding 100 meters per segment.
10BaseT—An Ethernet term meaning a maximum transfer rate of 10 Megabits per second that uses baseband signaling and twisted pair cabling.
(i) Simplex
(ii) Half-duplex
(iii) Full-duplex.
Two types of transmission technology available are:
(i) Broadcast
Below line will convert